A grouped bar chart (aka clustered bar chart, multi-series bar chart) plots numeric values for two levels of categorical variables instead of one. Bars are grouped by position for levels of one categorical variable, with color indicating the secondary category level within each group.
Questions tagged [grouped-bar-chart]
138 questions
0
votes
1 answer
Nested axis labels for grouped bar chart in Vega Lite
I'm building a grouped bar chart using Vega-Lite. Every data point has a count, a sample and an fdr value. The bars are grouped per sample and in these groups, I want one bar per fdr-value. I was able to accomplish all of this using the following…

Pieter Verschaffelt
- 173
- 1
- 7
0
votes
1 answer
Stacked AND Grouped horizontal bar plot in Python
I am trying to obtain a stacked and grouped horizontal bar plot in Python:
female_numbers_2015 = [20882, 31322, 52204, 52205, 31322, 20881]
female_numbers_2018 = [20882, 31322, 52204, 52205, 31322, 20881]
male_numbers_2015 = [11352, 17080, 28380,…

Michelle13
- 43
- 5
0
votes
0 answers
How to sort a grouped bar chart in Observable Plot in Javascript / TypeScript
I have a grouped bar chart made using Observable Plot, and I can't override the auto sort feature in this library. I have 2 possible routes to go, and I'll use whichever can solve the problem.
The first is preferred, which looks like this. The…

Adam
- 21
- 3
0
votes
0 answers
3-dimensional array to dataframe in R for optimized boxplotting
I am handling a slightly large set of data (dimensions 360,25,3): dimensions correspond to (event_severity,zone,model) respectively. I also have a similar dataframe for another time window
I imagine my data to be organized into three stacked…

Andrea Galletti
- 9
- 1
0
votes
1 answer
Grouping bar chart by filtered rows (R)
I want to display time series data on a grouped bar chart. I filtered the two variables from one column (x, y). Unfortunately I can't figure out how to display them grouped.
Using the code below will stack the…

onlyjust17
- 125
- 5
0
votes
1 answer
Aligning line and grouped bar charts
I am trying to plot a line chart on top of a bar chart using Python's pandas library. The bar chart is a clustered chart from a DataFrame and looks like so when plotted by itself:
Clustered Bar Chart
The line chart is the averages across the whole…

Michael
- 3
- 3
0
votes
1 answer
How to make grouped barchart with different columns as groups
I have a dataframe with 4 columns. Three are the concentrations of heavy metals in whales with two different feeding modes. Is it possible to have a grouped barchart with concentration (ug/g) on the y axis then three different groups for the element…

poxyatr
- 11
- 1
0
votes
1 answer
multi-bar plot of multiple categories
I have a data frame that basically is a list of Technicians and several categories that have been evaluated in their work (value 1 for passed evaluation, 0 for not passed). Each technician is repeated for every evaluation.
in a dictionary form…
user23415
0
votes
1 answer
Issue with y-ticks alignment in pandas bar chart
here is the data and code that I'm using to plot the bar chart as shown in the output plot. The issue is with y-ticks, I need to have y-ticks aligned in a vertical manner such that they cover/coincides with all four bars. If we use rot = 'some int…

Omi
- 69
- 8
0
votes
2 answers
Transforming dataframe before plotting
I want to create a horizontal bar chart, however I think I would have to use the pivot method first. The current dataframe consists of two rows and many columns:
Names not_needed not_needed2 year1 year2 year3
…

HoopsMcCann
- 347
- 2
- 3
- 18
0
votes
3 answers
how to get spacing between grouped bar plot
I have plotted the grouped bar plot and I want to have spacing between orange and blue bar.
I am not sure how to.
It is the sample image - I want little space between blue and orange bar.
import numpy as np
import matplotlib.pyplot as plt
N=4
a =…

Eli Smith
- 99
- 1
- 9
0
votes
1 answer
How to make a grouped bar chart from a Pandas DataFrame
How can I use pyplot to plot this dataframe:
Team Boys Girls
0 Sharks 5 5
1 Lions 3 7
data = {'Team': ['Sharks', 'Lions'], 'Boys': [5, 5], 'Girls': [5, 6] }
df = pd.DataFrame(data)
so that I can end up…

thePandasFriend
- 115
- 2
- 10
0
votes
2 answers
Create a grouped bar plot using seaborn
I have a dataframe as below
category val1 val2 val3
A 2 3 2
A 3 4 1
B 4 5 2
C 3 3 2
B 4 5 2
C 3 3 2
I am trying to create a grouped bar visual that has category in the…

codelearner0504
- 71
- 6
0
votes
1 answer
Is there a parameter in Seaborn catplot to display bars with zero value?
I am using catplot from Seaborn to create this graph to compare the error rate for each x value depending on the complexity. I know that the error rate is zero in some cases hence there is no bar to represent it but is there a way to show that in…

London-35
- 75
- 9
0
votes
1 answer
Bar graph spacing between grouped bars
I have a bar graph displaying annual counts of data from 1996-2020. Each year has 2 bars assigned to it. I can't figure out a way to increase the spacing between each group of 2 bars (or between each year). I know I can change the bar width, but…

bayouwxman
- 79
- 1
- 3
- 11