I have a ggplot2
linegraph with two lines featuring significant overlap. I\'m trying to use position_jitterdodge()
so that they are more visible, b
On July 2017, developpers of ggplot2
have added a seed
argument on position_jitter
function (https://github.com/tidyverse/ggplot2/pull/1996).
So, now (here: ggplot2 3.2.1
) you can pass the argument seed
to position_jitter
in order to have the same jitter
effect in geom_point
and geom_line
(see the official documentation: https://ggplot2.tidyverse.org/reference/position_jitter.html)
Note that this seed
argument does not exist (yet) in geom_jitter
.
ggplot(data = df, aes(x = dimension, y = value,
shape = Time, linetype = Time, group = Time)) +
geom_line(position = position_jitter(width = 0.25, seed = 123)) +
geom_point(position = position_jitter(width = 0.25, seed = 123)) +
xlab("Dimension") + ylab("Value")