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
1
vote
0 answers

How to prevent stacked bars aggregating by date in DASH?

I have a simple dataframe who's index is a time series. The dataframe looks something like this: I want to shows stacked bars for the 'Percent_male' and 'Percent_Female' columns using plotly.graph_objects and Dash. This works fine for data rows…
Jace999
  • 761
  • 1
  • 6
  • 7
1
vote
1 answer

Stacked Barplot with percentages of total, divided into groups

I am trying to plot a stacked barplot using the following df. My goal is to show the differential distribution of the "Marker"s in two different "Group"s (IPN, INV), so that the sum of all 4 subgroups (WT, MUT-i, MUT-p, MUT-d) equals a 100%. What is…
1
vote
1 answer

How to combine 2 discrete colormaps in matpotlib

I want to create a stacked bar chart with more than 20 discrete classes. The largest discrete colormap only has 20 colors, which is note enough for me. Below are the discrete colormaps: My idea is to combine/concatenate colormaps tab20b and tab20c…
Xtiaan
  • 252
  • 1
  • 11
1
vote
1 answer

matplotlib stacked bar chart change position of error bar

The error bars overlap in my stacked bar chart. Is there a way to change the x position of the error bar but keep the main bars at the same position? import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as…
1
vote
1 answer

Add error bar to ggplot2 stacked barplot, without using dodge

I can find examples of adding error bars to dodged barplots (e.g. here). However, is it possible to denote both a stacked barplot, with a single error bar at the top of each bar showing overall error? For example, like this middle plot below? How…
Thirst for Knowledge
  • 1,606
  • 2
  • 26
  • 43
1
vote
2 answers

Create a stacked bar plot of percentages and annotate with count

I have this data (df) and I get their percentages (data=rel) and plotted a stacked bar graph. Now I want to add values (non percentage values) to the centers of each bar but from my first dataframe. My code for now: import pandas as pd import numpy…
1
vote
1 answer

How to sort D3 Stacked Bar Chart over 2 object properties

I am fairly new to using D3 and have created a stacked horizontal bar chart based off of https://observablehq.com/@d3/stacked-horizontal-bar-chart. This is my chart: I am currently able to sort the chart by ascending and descending. What I need to…
1
vote
1 answer

GGplot columns don't exist

I'm VERY new to R and I am trying to make a stacking bar plot with each bar corresponding to a different year. Year will be the x axis while Frequency is on the y axis. I keep getting an error saying that "columns 2014,2015, ect dont exist". I don't…
Megan D
  • 25
  • 4
1
vote
0 answers

Plotting a stacked horizontal barplot

I have this dataframe called "df_pressure": Ranking Squad Press Succ Succ% Fail Fail% 11 1 Manchester City 4254 1381 32.5 2873 67.5 10 2 Liverpool 5360 1731 32.3 3629 67.7 5 3 …
Jun Jie
  • 11
  • 2
1
vote
1 answer

Matplotlib - Creating a Stacked barh with x axis labels positioned centrally and value labels positioned on inside of outer edges

I'm looking to create a barh plot where the index appears as a label in the center of the row and the values appear on the inside edges of the chart, essentially replicating Excel's 'inside end' and 'inside base' label positions The following is a…
bjwphneb
  • 57
  • 4
1
vote
1 answer

Chartjs Stacked bar graph with forEach for labels

sorry if this has been answered already but I cant figure how to include labels in my for each. Im getting my data from spring boot with the data called 'employees' and there is 20 something employees in the 'employees' data. I loop through and add…
1
vote
2 answers

ggplot2: Automatically Shade Bar With Minimum Value In My Stacked-Bar Chart With Facet Grid

I have created some stacked-bar charts in a facet_grid with ggplot2 where the performance of 2 methods(MB, TMB) are examined with 2 criteria(RMSE, MAE). What I Want I want to add a transparent grey shade to the bar with a minimum value for each…
Daniel James
  • 1,381
  • 1
  • 10
  • 28
1
vote
1 answer

How to Use Texture Fill in Stacked-Bar Chart for Facet Grid

I have this stacked-bar chart with a facet grid. Instead of the four colours used, I want to use the texture of different kinds. I am changing from coloured to texture to make each bar different if printed on black and white…
Daniel James
  • 1,381
  • 1
  • 10
  • 28
1
vote
0 answers

How to merge different "event types" in Google Data Studio stacked bar chart visualization?

Sample Data: video_id video_num event starting_time length_sec 3ofhi23r2 1 stall 3:15:00 81 3ofhi23r2 1 load 3:16:21 71 3ofhi23r2 2 load 3:17:31 10 3ofhi23r2 3 …
1
vote
1 answer

How to create a 100% stacked bar plot from a categorical dataframe

I have a dataframe structured like this: User Food 1 Food 2 Food 3 Food 4 Steph Onions Tomatoes Cabbages Potatoes Tom Potatoes Tomatoes Potatoes Potatoes Fred Carrots Cabbages Eggplant Phil Onions Eggplant Eggplant I want to use…
Steve
  • 87
  • 9