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
2 answers

stacked bar chart using seaborn and matplotlib

I am new to pandas and matplotlib and trying to accomplish following. I have a data frame as shown below which is actually a listing the performance of players based on match date name runs match_date player_id Dockrell, G H 0 …
Neel
  • 613
  • 4
  • 14
  • 32
2
votes
2 answers

Plotting stacked barchart with pandas of multiple columns grouped

I have two dataframes which I need to get the difference and then plot one of them on top of this difference. Here is a minimal example: import pandas as pd import matplotlib.pyplot as plt df1 =…
aripod
  • 55
  • 1
  • 14
1
vote
1 answer

adding a comma to float format in python for stack bar charts

I'm trying to print out this stacked bar chart and I want to add a comma after numbers in thousands. For example, if 7000 -> 7,000; if 20000 -> 20,000. I'm trying to add the code fmt='{:,.0f} to my graph but it is not giving me anything and I can't…
vanetoj
  • 103
  • 11
1
vote
1 answer

Plotting comorbidity data in a stacked circular bar chart

I'm essentially wanting to create this terrible hand drawn graph (see below) for a dataset I have of where I want to illustrate the spread of comorbid diagnoses people with specific pain conditions have. Larger image of below drawing here: So, I…
1
vote
0 answers

How can I generate a stacked bar chart with a for loop using data queried from a database

I've written some code that should loop through the dates in a selected date range within a data table and generate a stacked bar chart. I took a look at: multiple horizontal stacked bar charts using for loop and Plotting a stacked Bar Chart but…
1
vote
0 answers

How to create JSON data for a stacked bar chart from react-chartjs2

I am having this data from api, I want to make a stacked bar chart in reactjs from this data - [{ "project_id": 1, "project_name": "P1", "assessment_id": 1, "assessment_name": "Assessment 01", "maturity": "10" }, { …
1
vote
2 answers

Unilateral error bars in plotly stacked bar chart

How can I get unilateral error bars in the stacked bar chart in plotly below? import plotly.graph_objects as go y1_values = [5, 4, 4, 5, 6, 5] y2_values = [9, 8, 7, 6, 5, 4] y3_values = [4, 6, 7, 7, 7, 9] y1_errors = [0.5, 0.6, 0.4, 0.7, 0.5,…
hans
  • 323
  • 1
  • 14
1
vote
0 answers

ChartJS bar graph to show different width for different graph

I have created a Marimekko chart using chartjs and react , but i have a problem in assigning different width for each stack bar . I tried barPercentage,categoryPercentage but nothing works . below is my chart , as seen every bar has same width , i…
1
vote
1 answer

Specific order of data in stack bar plot using ggplot

I am trying to build a stacked bar chart based on percent exceedance. The plot orders the data by the size of the value, not the order of the percent exceedance. Here is the data and the ggplot code used: Qs_melt$Quartiles <-…
Koda
  • 165
  • 5
  • 13
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

How to plot the frequency of multiple groups of yearly data from a dataframe

I am trying to display a comparison visual of movies and series from a dataframe downloaded from kaggale.Please see first image. The issue is the graph, the graph is only displaying the xticks, grid, title, xlabel, ylabel and legend and not the…
EyeOfIlum
  • 23
  • 4
1
vote
1 answer

How to change the ordering how the categories are shown in the stacked chart and get rid of "a" in the legend in r?

I've been trying for hours to get rid of the "a" in the legend. I saw solutions here for that but the solution was to get rid of the legend altogether. However, I want to keep it. Apart from that, I want the values to start with the mandatory school…
TFT
  • 129
  • 10
1
vote
1 answer

How to split two geom_bar in two separate legends?

What I am trying to do here is to get a stacked bar plot which is working as expected except for the fact that I would like to have two separate legends, one for each set of stacked bars. In other words, I need a legend for each bar representing…
gabt
  • 668
  • 1
  • 6
  • 20
1
vote
1 answer

Using ggplot to make a stacked bar plot in R

I have this small subset of a larger data frame: years <- c(2015, 2019, 2020, 2021, 2021, 2022) Points <- c(7, 26, 9, 18, 28, 12) Design <- c("Standard 2019", "Standard 2019", "Standard 2019", "Standard 2019", "LCT 2021", "LCT 2021") PointSummary…
DrewB31
  • 11
  • 1
1
vote
1 answer

Merging Percentage Lines with The Bars in Tableau Desktop

I have a graph that shows the ratio (count) of payable vs. processed words among the total words on stacked bars. I would also like to display the same ratio in percentages in lines overlapping the bars. At the moment I have them in two separate…