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
2
votes
1 answer

Stacked bar chart: how to make diverging and vertically centered?

I am using D3 to make a stacked bar chart (for more artistic purposes than scientific). I want to design my stacked bar chart to be centered around one group, with half above and half below an invisible line, and have the other two groups be on…
2
votes
0 answers

Reachart minPointSize props does not work when using in stackedBarChart

Problem: I am working on stackedBarChart where on particular data if there is no data we need show dash as a indication there but there is data normal we have to show stackedBar but when trying to show dash using minpointsize prop of stackedbarchart…
2
votes
1 answer

Stacked bar plot with seaborn or matplotlib, having hue

I want to have a stacked bar chart which has the date as on X, a value on Y and a non-known number of values stacked on each other. The table looks like…
Hemmelig
  • 803
  • 10
  • 22
2
votes
2 answers

Create a stacked bar plot and annotate with count and percent

I have the following dataframe import pandas as pd import matplotlib.pyplot as plt import matplotlib print('matplotlib: {}'.format(matplotlib.__version__)) # 3.5.3 df=pd.DataFrame({'Type': [ 'Sentence', 'Array', 'String', '-','-', 'Sentence',…
Mario
  • 1,631
  • 2
  • 21
  • 51
2
votes
1 answer

How to group bars together in a stacked bar plot? ggplot R

How do I get the stacked bars in group KAPA, TAKARA and plasmid_DNA to group separately on this bar chart? This is what I've tried, but each group contains all columns even if empty: s %>% rownames_to_column(var = "id") %>% filter(id !=…
Ishan Mehta
  • 326
  • 1
  • 9
2
votes
1 answer

100% Stacked and grouped barplots using matplotlib

Sorry if this question is duplicated as I am not able to find a solution. I do have a data frame: | sample_ids | perc_A | perc_B | perc_C | |------------|--------|--------|--------| | sample 1 | 0.75 | 0.18182| 0.42222| | sample 2 | 0.66667|…
Naomi Sun
  • 47
  • 5
2
votes
1 answer

ggplot2 barchart grouped by two variables and then stacked by two more

I just can't quite get this plot working. I have one more variable than the examples I can find on here. I have a dataset like so: df <- data.frame( Type=sample(c('A', 'B', 'C', 'D'), 30, T), Geno=rep(LETTERS[1:3], 10), Count=sample(1:5,…
user2472414
  • 131
  • 11
2
votes
1 answer

Show the legend name horizontally on top of the chart (flutter chart)

I am using this SfCartesianChart in flutter and here I want to show the legend name horizontally on top of the chart like father, mother, son, and daughter. I don't want to show it vertically. and I also want to change the icon which presents the…
2
votes
1 answer

Pandas plot of a stacked and grouped bar chart

I have a CSV-file with a couple of data: # Comment header #…
WolfiG
  • 1,059
  • 14
  • 31
2
votes
1 answer

GGPLOT2: Stacked bar plot for two discrete variable columns

I have a dataset with three columns (one categorical column and two-discrete variables column). I want to make a stacked bar plot to compare the values of the two discrete variables for each category. However, I get continuous coloring rather than…
sp29
  • 363
  • 4
  • 11
2
votes
1 answer

R ggplot2 with stacked column instead of grouped

I want to plot the data shown below as a grouped bar_plot. I tried position = "dodge" or position = "dodge2" but it didn't work. Ι also tried position = position_dodge() It kinda works if i use geom_bar instead of geom_col and remove the…
loizvla
  • 23
  • 4
2
votes
1 answer

Add ONLY the total values on top of stacked bars

I am working with the following bar plot: And I would like to add only the total amount of each index on top of the bars, like this: However, when I use the following code, I only get parts of the stacks of each bar. import matplotlib.pyplot as…
2
votes
1 answer

How to create a stacked bar plot from a wide dataframe

can you help me figure out what is wrong with this code? I am getting the same error message " "ufunc 'add' did not contain a loop with signature matching types (dtype(' dtype('
2
votes
1 answer

Stacked Bar Chart Python from pivot/groupby table

This is a sample data. How can I get Sum Amount in Y axis with quarter as stacked and region and year on X axis. Region Year Quarter Sum Amount A 2016 1 100 2 80 3 70 4 …
AB14
  • 397
  • 2
  • 13
2
votes
2 answers

How to plot 100% stacked bar chart

Let's assume I have DataFrame as below; df = pd.DataFrame({"name":["Foo", "Foo", "Baar", "Foo", "Baar", "Foo", "Baar", "Baar"], "count_1":[5,10,12,15,20,25,30,35], "count_2" :[100,150,100,25,250,300,400,500]}) I may plot the stacked graph as…
Sean
  • 51
  • 5
1 2
3
16 17