geom-bar Questions
1
Solved
I am building a chart of concentric circles using polar_coord in ggplot and I need to get rid of a specific line. Here's the code and the plot:
df <- data.frame(A=letters[1:12],
B=c(rep("Dim_1...
1
Solved
I'm trying to add a superscript to some x-axis values in order to connect to a footnote that'll be at the bottom of the page. The easy workaround would just be an asterisk instead of ^a but that wo...
Hexane asked 27/8, 2018 at 12:46
2
Solved
[Data and code to produce plot at the end of the post]
Using ggplot, I plotted a bargraph with error bars, bars are grouped by two factors (one on X axis, one with fill). I would like to increase ...
Adulterer asked 17/8, 2018 at 9:57
2
Solved
Is there any way to plot geom_bar with geom_line like the following chart.
I have come up with the two separate charts. How to combine them with two different axes on the left and right sides re...
4
Solved
I would like to create a stacked chart using ggplot2 and geom_bar.
Here is my source data:
Rank F1 F2 F3
1 500 250 50
2 400 100 30
3 300 155 100
4 200 90 10
I want a stacked chart where x is th...
2
Solved
geom_bar seems to work best when it has fixed width bars - even the spaces between bars seem to be determined by width, according to the documentation. When you have variable widths, however, it do...
2
Solved
I want to draw a bar chart with ggplot2 along with custom y limits.
Type <- LETTERS[1:5]
Y <- c(99, 99.5, 99.0, 98.8, 98.5)
df <- data.frame(Type, Y)
The following code works fin...
2
Solved
I have proportion response data for 4 experimental groups, with 2 different statistics computed for each group. I want the following figure (which I can achieve):
I obtain this figure with the fol...
1
I'm trying to change the color in a barplot in ggplot2 using scale_fill_manual, but for some reason only works if i use the fill option inside aesthetics.
I made an example:
library(ggplot2)
libra...
1
Solved
I'd like to visualize a data using bar chart and ggplot.
I have the data below, when I want to vis this data the text for negative values are not showing below the Bar .
dat <- read.table(te...
2
Solved
I am having a really hard time recreating an excel example with ggplot2. I have tried numerous examples but for some reason I cannot reach my desired result. Can someone please have a look at my ex...
1
Solved
I am trying to move the facet strip to the far left of my plot, so that the labels sit adjacent to the bars, and the grouping strips sit to their left (see my example below).
I assume this must b...
Recessional asked 7/4, 2017 at 1:52
2
Solved
In the df below, I want to reorder bars from highest to lowest in each facet
I tried
df <- df %>% tidyr::gather("var", "value", 2:4)
ggplot(df, aes (x = reorder(id, -value), y = valu...
1
Solved
I want to be able to create a bar graph which shows also shows the mean value for bars in each group. AND shows the mean bar in the legend.
I have been able to get this graph Bar chart with means ...
1
Solved
Main issue: I want to display the data from 0 to 1.0 as an upward bar (starting from 0) but do not want the intervals to be equally spaced but log spaced.
I am trying to display the column labeled...
2
Solved
I would like to adjust the text on the barplot.
I tried to adjust hjust/vjust to display as I like it but it seems like it's not working properly.
ggplot(data) +
geom_bar(aes(name, count,
fil...
1
Solved
I have a question concerning the order of data in my geom_bar.
This is my dataset:
SM_P,Spotted melanosis on palm,16.2
DM_P,Diffuse melanosis on palm,78.6
SM_T,Spotted melanosis on tru...
3
Solved
I have a simple bargraph like the following
a<-data.frame(x=c("total","male","female","low education",
"mid education","high education","working","not working"),
y=c(80,30,50,20,40,20,65,35)...
2
Solved
This is actually two questions in one (not sure if goes against SO rules, but anyway).
First question is how can I force a geom_text to fit within a geom_bar? (dynamically according to the values ...
1
Solved
Is it possible to use the stroke argument introduced with ggplot2 2.0 to adjust the thickness of borders around bars? If not, is there a way to control bar-border thickness along the lines of point...
2
Solved
I have a faceted bar chart done with ggplot2 with this code:
ggplot(data_long, aes(x=region, y=wert)) +
geom_bar(aes(fill = kat ), position = "dodge", width=.5, stat="identity") +
labs(y = "Wähle...
1
Solved
I'd like to have ordered bars in dodge geom_bar. Do you know how to deal with it?
My code:
ttt <- data.frame(typ=rep(c("main", "boks", "cuk"), 2),
klaster=rep(c("1", "2"), 3),
ile=c(5, 4, 6...
2
Solved
I can'd find a solution for the following problem(s). I would appreciate some help a lot!
The following code produces bar charts using facet. However, due to "extra space" ggplot2 has in some grou...
2
Solved
I am not sure if geom_bar is able (probably I'm not) to create the plot I need with geom_bar. I want a bar plot but not starting from 0, I have a minimum and maximum value that are to be the start ...
1
Solved
I want to plot frequency distribution of an [r] factor variable as a bargraph, where bars represent the frequency counts of the factor levels. I use ggplot2 to do that and there's no problem ...
© 2022 - 2024 — McMap. All rights reserved.