bar-chart

Matplotlib bar plot with table formatting

烂漫一生 提交于 2020-05-27 14:50:38
问题 I have added a table to the bottom of my plot, but there are a number of issues with it: The right has too much padding. The left has too little padding. The bottom has no padding. The cells are too small for the text within them. The table is too close to the bottom of the plot. The cells belonging to the row names are not colored to match those of the bars. I'm going out of my mind fiddling with this. Can someone help me fix these issues? Here is the code (Python 3): import seaborn as sns

Matplotlib bar plot with table formatting

佐手、 提交于 2020-05-27 14:48:54
问题 I have added a table to the bottom of my plot, but there are a number of issues with it: The right has too much padding. The left has too little padding. The bottom has no padding. The cells are too small for the text within them. The table is too close to the bottom of the plot. The cells belonging to the row names are not colored to match those of the bars. I'm going out of my mind fiddling with this. Can someone help me fix these issues? Here is the code (Python 3): import seaborn as sns

ggplot2 - Bars non-aligned to error bars

99封情书 提交于 2020-05-23 10:39:11
问题 I am trying to plot error bars over bars in R using ggplot2. The position of the bars is ok, however the error bars are misaligned, overlapped. Please take a look at the example below: library(ggplot2) df = structure(list(variable = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L), .Label = c("Stage1", "Stage2", "Stage3", "Stage4"), class = "factor"), scenario = c("A", "A", "A", "B", "B", "B", "A", "A", "A", "B", "B", "B", "A", "A",

Chart.js stacked bar chart - sorting values in bar by value

ε祈祈猫儿з 提交于 2020-05-23 07:44:31
问题 I try to implement a stacked bar chart using Chart.js framework (version 2.7) und faced following problem: single data elements are drawn in each bar in the same order as provided in JSON structure (which is absolutely logical and understandable). I would like to have them sorted: biggest elements at the bottom of the bar, smallest at its top. I suppose it can be accomplished using some plugin customization black magic but can not figure it out. Any help would be appreciated. Example: var

Highchart Barchart xAxis

情到浓时终转凉″ 提交于 2020-05-17 08:51:13
问题 I have High Chart Bar chart... I had set value xAxis in to Usa,Canada,Japan,USA,Canada,Japan,Usa,Canada,Japan I need to Set the name Under each Usa,Canada,Japan 1st level and 2nd level and 3d Level x Axis: { type: 'category', categories: ['USA', 'Canada', 'Japan', 'UsA', 'Canada', 'Japan', 'USA', 'Canada', 'JAPAN'], under each Categories I need to 1st level and 2nd level and 3d Level enter image description here 回答1: Take a look at this plugin: https://www.highcharts.com/plugin-registry

How to add error-bars to a grouped stacked barplot in R which requires reversing of levels?

那年仲夏 提交于 2020-05-17 07:26:37
问题 I'm trying to create a stacked barplot with errorbars. The datafile is here: https://github.com/Ginko-Mitten/Experimental.git library(ggplot2) Dat1<-Methods_Recovery_Comparison Volunteer<-as.factor(Dat1$Volunteer) Method<-as.factor(Dat1$Method) Phase<-as.factor(Dat1$Phase) Recovery<-as.numeric(Dat1$Recovery) SD<-as.numeric(Dat1$SD) SDU<-Recovery+SD SDL<-Recovery-SD Ext<-data.frame(Volunteer,Method,Phase,Recovery,SD,SDU,SDL) ggplot(Ext,aes(Method))+ geom_bar(aes(weight = Recovery, fill = Phase

Broken axis slash marks inside bar chart in matplotlib?

大憨熊 提交于 2020-05-16 02:31:28
问题 I've seen matplotlib examples of placing the broken axis slash marks on the axes, such as this one. My questions, how can I place it where the bars are broken? Can this be done in a programmatic way for updating time-series plots month over month? Below is an example of what I want done, using excel. Notice the tildes in the Paris June bar and the Madrid May bar. The tildes hide a portion of the bar it's covering. I'm also providing easier sample data and what I've been able to do so far. XX

Broken axis slash marks inside bar chart in matplotlib?

只愿长相守 提交于 2020-05-16 02:29:13
问题 I've seen matplotlib examples of placing the broken axis slash marks on the axes, such as this one. My questions, how can I place it where the bars are broken? Can this be done in a programmatic way for updating time-series plots month over month? Below is an example of what I want done, using excel. Notice the tildes in the Paris June bar and the Madrid May bar. The tildes hide a portion of the bar it's covering. I'm also providing easier sample data and what I've been able to do so far. XX

GGplot Barplot does not accept Y value?

别来无恙 提交于 2020-05-14 18:12:50
问题 I have a dataframe: >picard count reads 1 20681318 2 3206677 3 674351 4 319173 5 139411 6 117706 How do I plot log10(count) vs log10(reads) on a ggplot (barplot)? I tried: ggplot(picard) + geom_bar(aes(x=log10(count),y=log10(reads))) But it is not accepting y=log10(reads). How do I plot my y values? 回答1: You can do something like this, but plotting the x axis, which is not continuous, with a log10 scale doesn't make sense for me : ggplot(picard) + geom_bar(aes(x=count,y=reads),stat="identity"

Side-by-side bar chart with columns proportional by group (relative frequency bar chart)

霸气de小男生 提交于 2020-05-14 12:39:01
问题 The dataset gender <- c('Male', 'Male', 'Male', 'Female', 'Female', 'Female', 'Male', 'Male', 'Male', 'Female', 'Female', 'Female', 'Female', 'Female', 'Male', 'Female', 'Female', 'Male', 'Female', 'Female') answer <- c('Yes', 'No', 'Yes', 'Yes', 'No', 'No', 'No', 'No', 'No', 'No', 'No', 'Yes', 'No', 'No', 'Yes', 'Yes', 'Yes', 'Yes', 'No', 'Yes') df <- data.frame(gender, answer) is biased towards females: df %>% ggplot(aes(gender, fill = gender)) + geom_bar() My task is to build a graph that