1,087 questions
2
votes
2
answers
102
views
Reorder stacked bar graph by value [duplicate]
What is the easiest-to-replicate way of reordering these bar graphs (
group1, group2) so that it is arranged in ascending order of col3 from bottom to top? I am looking for a solution that can be used ...
1
vote
1
answer
90
views
Positioning geom_text in ggplot coord_polar chart
I am building a pie chart in ggplot using geom_bar and coord_polar and having problems with positionning the labels with geom_text. Ggplot seams to change the order of the classes and put the labels ...
0
votes
1
answer
44
views
Errbars positions and bar widths adjustment of a grouped barplot
I was able to produce a barplot by using following codes. However, the errobars are situated in the middle of the grouped bars, which share the same values of x-axis values (DAS). The width of grouped ...
0
votes
1
answer
54
views
adjust bar width, padding, and distance between x categories INDEPENDENTLY in 2 factor ggplot
I am trying to create a 2-factor plot where I can increase the distance between categories (dog vs. cat) WITHOUT affecting the padding between bars or width of the bars. This has been a whack-a-mole ...
-1
votes
1
answer
70
views
how to make lines between stack bar charts?
I have trouble making line between two paired stacked boxplot. Im comparing pre ->post cellular composition change, though hard to draw line between the plots. shown below is my current script. I ...
0
votes
1
answer
89
views
How to truncate geom_bar in R at a given value of the y-axis
I have this code for a geom_bar plot
ES <- ggplot(dfES, aes(x=Scenarios, y=Mean)) +
geom_bar(position=position_dodge(), stat="identity",
fill="lightblue", colour='...
-1
votes
1
answer
62
views
How to order fill variable in bar plot ascending for each x factor level? [duplicate]
I make a bar plot with two factors, one lays on the x axis and the other determines the fill color of the bars. I want to be the bars ascending from left to right within each x factor level. Further, ...
0
votes
1
answer
45
views
Showing a legend in a faceted plot with both bars and points
My legend is overlaying the point on the legend entries for the bars.
I don't want the dots in my legend entries for "Shoot 1", etc.
This answer partially fixed my problem, although I think ...
0
votes
1
answer
541
views
Fill and color manual a geom_bar_pattern
I have count data from several samples, which map to two classes, two groups, and three types:
library(dplyr)
set.seed(1)
df <- data.frame(type = c(rep("A",12), rep("B",12), rep(...
0
votes
1
answer
48
views
Why do the bars in the grouped barplot have different heights although having the same percentage (ggplot in R)?
I want to represent percentages for categories of "more_know" from 1 to 7 within each group of "study". In the barplot, the height of category 1 is for both groups 3%. However, ...
2
votes
2
answers
67
views
How to show empty levels in faceted plots?
I have a data frame that contains information classified by 2 factors, factor “a” and factor “b”. Factor “a” has levels A, B and C and factor “b” has levels R, S, T, U and V.
a <- c("A", &...
0
votes
0
answers
58
views
Why `geom_arc_bar()` width is not uniform ? How to make it the same width everywhere?
From this dataset:
data <- data.frame("type" = c("low_carbon", "high_carbon"),
"start" = c(0, 0.7 * pi),
"...
1
vote
1
answer
481
views
Draw ggplot2 barplot with round corners
I used the "ggchicklet" package to produce rounded stacked bar plots in R. However, this package is no longer available.
On R News page is written "Use ggforce to replace ggchicklet as ...
-1
votes
1
answer
74
views
R: ggplot distribution diagram with 'more than limit' bar and geom_vline
colleagues.
I am trying to build a distribution diagram that will satisfy the following conditions:
Shows percentage of the values lying in each bin.
Bin size is specified by user.
All the bars are ...
1
vote
3
answers
61
views
Using geom_text or geom_label inside geom_bar
I am plotting the publication of scientific papers on a specific research topic on a timeline. I would like to add author and year to the corresponding rectangles using the "label" variable.
...