Questions tagged [stacked-bar-chart]

A stacked bar chart is a graphical representation of data where, for each categorical group, there are two or more bars colored to represent a particular grouping. The value is represented by the length of the bar segment.

247 questions
3
votes
1 answer

geom_text position middle on the stacked bar chart

# Loading data data(CPS85, package = "mosaicData") # Count the number of females and males in each sector plotdata <- group_by(CPS85,sector) %>% count(sex) # Print the data print(plotdata) # Construct a ggplot object according requirement above…
Jane_IDK
  • 65
  • 7
3
votes
1 answer

Single Stacked Bar Chart Matplotlib

I am struggling to get a single stacked bar chart using matplotlib. I want to create something like this: Horizontal Stacked Bar Chart However, even if I use df.plot.barh(stacked=True, ax=axes_var, legend=False) I get two separate bars. My data…
3
votes
4 answers

How to create a stacked bar chart in r with ggplot

My data is: positive <- c("21", "22", "33", "21", "27") ##Percentage negative<- c("71", "77", "67", "79", "73") ##Precentage sample <- c("Hr", "Fi", "We", "Pa", "Ki") mydata <- data.frame(positive , negative, sample) I want to create a stacked…
Santiago99
  • 143
  • 4
3
votes
2 answers

Create a circular bar plot

I am trying to create a circular bar plot using my data, but I could not even organize the data frame in order to do it. I have 121 seed analizes from 3 different years (column named campana), and from 4 regions of a province (column named zona). I…
PamDir
  • 33
  • 3
3
votes
3 answers

How to create stacked bar chart color coded by category

I'm working on a popular Titanic dataset on Kaggle, and I would like to create a bar chart showing the numbers of survivors vs. deceased by gender. On the x-axis, I want gender (male/female). I want to have the survivors and deceased stacked and…
3
votes
2 answers

How can I group a stacked bar chart?

I'm trying to create a grouped, stacked bar chart. Currently I have the following DataFrame: >>> df Value Rating 1 2 3 Context Parameter …
2
votes
0 answers

How do I create grouped and stacked bars?

I have a df where each row represents a cell, the first column represents its celltype, the second column represents it is a common celltype or a rare one, and the last column represents the corresponding patient's name. Like this: the overview of…
2
votes
1 answer

Stacked barchart in C3.js don't show group

I am trying to make a stacked barchart in C3.js with a JSON with the fields product, month, amount_sale, for example: [{"product": "Pulp", "month": "january", "sale_amount": 320}, {"product": "Pulp", "month": "february", "sale_amount":…
Aegis
  • 113
  • 7
  • 27
2
votes
0 answers

How to adjust error bars position in matplotlib stacked bar plot?

Im trying to plot a stacked bar plot in matplotlib including error bars for each slice in the stack. The problem is, that at the moment, the error bars are positioned in y-orientation at the mean value of the slice, causing them to clump at the…
2
votes
2 answers

How to order stacked bar chart in python?

I have a data frame: import pandas as pd data = { 'BU': ['A', 'C', 'C', 'E', 'E', 'A', 'D', 'C', 'D', 'E', 'A', 'A', 'C', 'D', 'E', 'A', 'B', 'C', 'D', 'A', 'B', 'C', 'E', 'E', 'A', 'A'], 'Sub - BU': ['A2', 'B1', 'C1', 'D1', 'E1', 'A1', 'B1', 'C1',…
hvahva
  • 51
  • 5
2
votes
2 answers

ggplot2: Display shift in stacked histogram

I am trying to replicate a figure used in Stroke research to display results of clinical trials. I have included a figure down below as an example of the end result. In a nutshell, the figure is a stacked histogram in percentage for two conditions…
2
votes
1 answer

The R plot_ly stacked bar chart can only show multiple values with different colors

I am programming a R-application, where I need to visualize data in stacked bar-charts. So far everything works fine if there are multiple bars shown, but I am getting empty graphs when I want to show only one bar. So I created different plots with…
Jakob
  • 45
  • 7
2
votes
1 answer

is it possible to stack 2 bars, layer on top of each other (not above each other)?

Trying to build a bar chart where each bar is essentially 2 bars layered on top of each other, and the top-most bar will be thinner than the bottom bar. I see the existing feature where if you provide a "stackId", it stacks it, but it is stacked…
fungtional
  • 69
  • 4
2
votes
1 answer

Clicking on one plot opens another in plotly

I've a stacked bar plot(as shown in below diagram) plotted using plotly in python What I want is whenever I click on any particular bar of any stacked bar, it show a corresponding line plot. eg :- Let suppose I click on A's bar then it should show…
2
votes
0 answers

Plotly Stacked Bar Chart: Different Coloring of Bars

I have created a stacked bar chart with Plotly for my Dash App, but I want to assign a different "color-scale" to each bar. There's 14 bars in total with subgroups of up till 14. The bar is depending on a range slider (years); it can show data from…
Camilla
  • 21
  • 2
1
2
3
16 17