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

How do I create grouped and stacked bars?

I have a df where each row represents a cell, the first column represents its celltype, the second column represents it is a common celltype or a rare one, and the last column represents the corresponding patient's name. Like this: the overview of…
2
votes
1 answer

Adding bar labels shrinks dodged bars in seaborn.objects

I am trying to add text labels to the top of a grouped/dodged bar plot using seaborn.objects. Here is a basic dodged bar plot: import seaborn.objects as so import pandas as pd dat = pd.DataFrame({'group':['a','a','b','b'], …
2
votes
0 answers

How to create a threshold in Observable Plot in JavaScript / TypeScript

I am trying to create a grouped bar chart using Observable's Plot.plot in JavaScript (code is in TypeScript). The problem is that the x-axis is showing each specific date, however I want the dates to show dynamic months or weeks, not specific…
Adam
  • 21
  • 3
2
votes
1 answer

How to annotate grouped bars with the value and text from a different column

I am trying to get a bar plot in seaborn with vertical text alignment. The name text is aligned vertically but it maintains some gap between each bars. I need to align the name text in top of the bar vertically and also the col3 values inside the…
Berlin Benilo
  • 472
  • 1
  • 12
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

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

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

How to add x-axis tick labels in python bar chart

I am trying to plot a python bar chart. Here is my code and an image of my bar chart. The problems I am facing are: I want to write name of each category of bar chart on the x-axis as CAT1, CAT2, CAT3, CAT4. Right now it's printing 0, 1, 2 on the…
user12
  • 761
  • 8
  • 24
2
votes
1 answer

Seaborn grouped barplot with total values instead of mean

I got a question on how to organize my data to make a barplot with seaborn. My data input looks like the following influencer platform reach person a instagram 10000 person b instagram 5000 person a instagram 8000 person a youtube …
Christopher B
  • 112
  • 1
  • 10
2
votes
1 answer

Equal distance grouped bar chart irrespective of scale - chart.js

I have a requirement that need to show up data in bar graph using chart.js like below, Here, irrespective of x-axis date, the bars should be aligned in equal distance and the date format is same as in the image. let chartStatus =…
2
votes
1 answer

How to center multiple bar plots on x ticks?

I am trying to plot a grouped bar plot, but the bars are shifted. In the example below, I want the x ticks to be centered between the green and orange bars, so that the whole stack is centered. x = [56.35035714285714, 49.573170731707314,…
M.A.G
  • 559
  • 2
  • 6
  • 21
2
votes
2 answers

How to add error bars to a grouped bar plot

I would like to add error bar in my plot that I can show the min max of each plot. Please, anyone can help me. Thanks in advance. The min max is as follow: Delay = (53.46 (min 0, max60) , 36.22 (min 12,max 70), 83 (min 21,max 54), 17 (min 12,max…
Vincent
  • 219
  • 2
  • 5
  • 13
2
votes
3 answers

How to plot a grouped bar plot from a dict of dicts

I have a nested dict that looks like this: mydict = { 'A': {'apples': 3, 'bananas': 5, 'kiwis': 9, 'oranges': 6}, 'B': {'apples': 1, 'bananas': 9, 'kiwis': 1, 'oranges': 3}, 'C': {'apples': 6, 'bananas': 9, 'kiwis': 3, 'oranges': 3}, } A,B,C are…
user1189851
  • 4,861
  • 15
  • 47
  • 69
1
vote
1 answer

Set spacing between grouped bar plots in matplotlib

I'm currently analyzing earthworm count data collected within an on-field experiment. My variables are style of site (experimental site vs. reference site), the year the data has been collected, the crop that was cultivated and the number of…
Laura
  • 23
  • 3
1
vote
1 answer

Issue with titles in ggplot multiple grouping bar

I have a code like this: library(reshape2) library(ggplot2) df <- read.csv("B5.csv", stringsAsFactors=FALSE, header=TRUE) df.long<-melt(df,id.vars=c("ID","Type","Annee")) df.long$value <- gsub(" ", "", df.long$value) df.long$value <- sub("O",…
anikaM
  • 409
  • 1
  • 4
  • 9
1 2
3
9 10