Questions tagged [position-dodge]
20 questions
45
votes
2 answers
ggplot2 - jitter and position dodge together
I am trying to recreate a figure from a GGplot2 seminar http://dl.dropbox.com/u/42707925/ggplot2/ggplot2slides.pdf.
In this case, I am trying to generate Example 5, with jittered data points subject to a dodge. When I run the code, the points are…

user1381239
- 553
- 1
- 4
- 5
33
votes
4 answers
How to make dodge in geom_bar agree with dodge in geom_errorbar, geom_point
I have a dataset where measurements are made for different groups at different days.
I want to have side by side bars representing the measurements at the different days for the different groups with the groups of bars spaced according to day of…

user1771185
- 331
- 1
- 3
- 3
2
votes
1 answer
R ggplot: How to align points with dodged bars?
I'd like to know how to align geom_point points with the geom_bar dodged bars positions.
The bars are dodged according to the Year parameter but the points all plot in the middle of the dodged bars regardless of their Year parameter.
Reproducible…

GonzaloXavier
- 128
- 3
- 13
1
vote
1 answer
Is there an R function to dodge overlapping values in a geom_segment plot?
I have this data:
"","NAME","PRE","start","end","jit"
"1","A","Treatment A",2024,2024.5,0
"2","B","Treatment A",2026,2026.5,0
"3","C","Treatment A",2024,2024.5,0
"4","D","Treatment A",2026,2026.5,0
"5","E","Treatment…

UnsoughtNine
- 63
- 1
- 8
1
vote
1 answer
Overlaying two bars in ggplot2 using position_dodge() without changing alpha value
What I'm wanting to do is have non-additive, 'stacked' bars, which I understand is achieved using position_dodge, rather than "stack". However, this does not behave as I expected it to.
The closest answer to what I'm after is here, but the code on…

Brett
- 13
- 3
1
vote
1 answer
Position dodge not working in time series
I want to dodge the points and error bars on this time series, but I keep getting stacked points/error bars
AcrossSites<-structure(list(ExpectedPA = structure(c(1L, 1L, 1L, 1L, 1L, 2L,
2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 5L, 5L,…

Hallie
- 11
- 2
1
vote
1 answer
Why does `color` override `position` in ggplot?
I'm having a problem whereby a setup that works for position-dodging
gets disabled if I specify an alternative color. Here is a reproducible example:
library(emmeans)
noise.lm = lm(noise ~ size * type * side, data = auto.noise)
emmip(noise.lm, side…

Russ Lenth
- 5,922
- 2
- 13
- 21
0
votes
1 answer
Dodge geom_points based on only a single grouping variable when there are multiple grouping variables
I am having an issue with trying to dodge points only by the color aesthetic when I am also using another aesthetic for shape. When I add the option to dodge, it dodges the points such that each shape+color option is dodged. Is there a way to…

Jeff
- 3
- 1
0
votes
0 answers
Error: object 'dodge' not found - Plot not working anymore
This graph was working perfectly before, and now it is giving me the error "Error: object 'dodge' not found". It used to work perfectly fine, and I didn't change the code. Does someone have any idea of what could be going on?
Thank you.
Here is the…

sandra
- 1
0
votes
1 answer
geom_text() alignment challenges with grouped bar plot
I am currently using position = position_dodge2(preserve = "single") within a geom_bar() function to produce two grouped bar plots, with consistent bar widths regardless of the number of levels within each group. This is working fine. The right and…

UnsoughtNine
- 63
- 1
- 8
0
votes
0 answers
geom_point and geom_errorbarh adjusting with position dodge
The data point and error bars are far away in the generated figure.
Here is the script
dat_combined %>%
arrange(depth_cm) %>%
ggplot(aes(x = mean_delta_13C, y = depth_cm)) +
geom_errorbarh(aes(xmin = mean_delta_13C - sd_delta_13c,
…

J.M
- 25
- 4
0
votes
1 answer
Combine 2 variables in scatterplot without dodge
I want to create a scatterplot that combines both days (in color) as observer (shape) in a scatterplot. However, with my current code the points will not only dodge on day (which I want), but also on observer (which i dont want). Here is my…

Marcel Vlig
- 33
- 4
0
votes
1 answer
Why is the 'dodge' command in ggplot2 not working for me?
Sort of a R rookie here. I'm trying to create a bar chart with three separate bars to represent the sum of correct answers for the control, treatment and both combined but the dodge argument doesn't seem to be working. I'll attach my R code…

Kat
- 1
- 2
0
votes
0 answers
geom_point dodge spreading unevenly
I am trying to plot antibody levels, GMT (Y axis) at four different time points (X axis) for a group of 55 individuals using geom_point, linking each person's data with geom_lines so I can see the trends over time (I don't have data for all time…
0
votes
1 answer
How to pair geom_point and geom_line with position_dodge?
geom_point (points) and geom_line (lines) are not paired in position in ggplot2 when using position_dodge
Here is my code:
ggplot(data = datae.19.26, aes(x=as.factor(assay.tem), y=change.fitness ))+
geom_point(aes(group=…

Scrooge Mike
- 17
- 3