Questions tagged [grouped-bar-chart]

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.

138 questions
1
vote
1 answer

How to plot data from snowflake into grouped bars overlaid with a line plot

The requirement to have two bar graphs displayed either through sql or python library based on TYPE Below is the data from the table with data as ( select 'DIRECT' as type , '2023-04-30' as report_month , 148 as returns_per_head , 30.00 as…
1
vote
1 answer

How to plot a grouped bar plot with data from multiple dataframes

how to plot multiple categories with different data lengths on the same bar chart in python? Here is my code: import pandas as pd import matplotlib.pyplot as plt Type_X = [200000, 150000] Type_Y = [168000, 120000] Comb = [192000] Cat = ['With Time…
Seun Alabi
  • 13
  • 2
1
vote
1 answer

Control the distance between stacked bars plotly

Is there a means to control the distance between the stacked bars in the example below, i.e. between the “cat” and “dog” (black arrow) and between “10 minutes” and “30 minutes” (yellow arrow)? import plotly.graph_objects as go x = [ ["10…
hans
  • 323
  • 1
  • 14
1
vote
1 answer

Grouped Bar Charts, Horizontal: Smaller distance between groups and labels?

I need to make a horizontal bar chart for a university assignment and I cannot figure out how to make the distance between the bars of the different groups smaller. And my labels to show the value of the bar are not in a correct position and none of…
minervax29
  • 11
  • 2
1
vote
1 answer

How can I add space between bars in a dodged (hue) group?

How can I add space between Male and Female bars in seaborn histplot ? import seaborn as sns tips = sns.load_dataset("tips") sns.histplot(data=tips, x="day", hue="sex", multiple="dodge", shrink=.9) plt.show()
1
vote
1 answer

Creating a Grouped Cleveland Plot

I want to make a cleveland style chart that allows the comparison of the probability of exhibiting behaviors by age compared between males and females. I have a dataset similar to this: Data <- data.frame( skill = c("Writes Name", "Reads 10…
1
vote
1 answer

custom errorbars for catplot with grouped bars in facets

pandas 1.5.3 seaborn 0.12.2 My code and part of the data is shown below. I am trying to plot the errorbars precomputed in the dataframe (val_lo,val_hi). It seems that sns.catplot with kind=bar has support using errorbar as mentioned here - how do…
ironv
  • 978
  • 10
  • 25
1
vote
1 answer

How can custom errorbars be aligned on grouped bars?

I have created a sns.catplot using seaborn. My goal is to obtain a barplot with error bars. I followed this answer to error bars to my plot. However, I now find that my error bars, using the same ax.errorbar function no longer align to my bar…
donkey
  • 1,343
  • 13
  • 32
1
vote
1 answer

Fitted values and confidence intervals on grouped bar chart

I have a dataset with 5 levels for treatment and 4 levels for time, and values for germination for those 20 combinations. I am trying to make a grouped bar chart that will show fitted values and confidence intervals from a glm that I have…
Stacey
  • 45
  • 4
1
vote
1 answer

Julia using StatsPlots.jl for grouped bar plot. How to get a legend on the bar plot?

I'm trying to plot some data using Julia, but I'm quite new to Data visualisation in Julia. I have code that looks like this: x_data = [5 10; 15 20] groupedbar( ["0.2", "0.8"], x_data, xlabel = "X-axis", ylabel="Y-axis") Each x-value…
1
vote
1 answer

Bar plot of two columns in x-axis in seaborn

My dataset is called df: year french flemish 2014 200 200 2015 170 210 2016 130 220 2017 120 225 2018 210 250 I want to create a histogram in seaborn with french and flemish on the x-axis and year as the hue. I tried this, but it…
user20494840
1
vote
1 answer

How to include both percent and N as bar labels in grouped bar chart

I recently asked a question and on how to include both % and N as bar labels and received assistance Include both % and N as bar labels I am trying to use that example in a bar plot over a variable as per the example below: data = { 'id': [1, 2, 3,…
Stephen Okiya
  • 315
  • 1
  • 8
1
vote
1 answer

How to add error bars in Altair based on different columns of a dataframe?

So I have columns of data, one of which is the average - which I want to show, and one of which is the std deviation - which I want the error bars of I'm starting using altair, but I have quite a bit of data like this and would like to initially use…
user3452643
  • 182
  • 1
  • 7
1
vote
1 answer

How to make a multiple bar chart?

How to make a bar chart using 'altair' to use the information in a table? If you need to change the table format is it ok, I want to make a bar chart as below. (My end goal is to create a bar chart in streamlit.) Example, import pandas as pd import…
SJJ
  • 25
  • 3
1
vote
1 answer

Plot multiples values in the same Column graph

I need to plot these graphs in the same plot, but i cant put it together, how can i make this? import pandas as pd import matplotlib.pyplot as plt import random import seaborn as sns plt.rcParams["figure.figsize"] = [7.50,…