position_jitter {ggplot2} | R Documentation |
Jitter points to avoid overplotting
position_jitter(xjitter=NULL, yjitter=NULL, ...)
xjitter |
degree of jitter in x direction, see ?jitter for details, defaults to 1 if the x variable is a factor, 0 otherwise |
yjitter |
degree of jitter in y direction, see ?jitter for details, defaults to 1 if the y variable is a factor, 0 otherwise |
... |
other arguments |
This page describes position_jitter, see layer
and qplot
for how to create a complete plot from individual components.
A layer
Hadley Wickham, http://had.co.nz/
## Not run: qplot(am, vs, data=mtcars) qplot(am, vs, data=mtcars, position="jitter") # Control amount of jittering by calling position_jitter qplot(am, vs, data=mtcars, position=position_jitter(x=10, y=0)) qplot(am, vs, data=mtcars, position=position_jitter(x=0.5, y=0.5)) # See lots of actually useful examples at geom_jitter # You can, however, jitter any geom, however little sense it might make qplot(cut, clarity, data=diamonds, geom="blank", group=1) + geom_path() qplot(cut, clarity, data=diamonds, geom="blank", group=1) + geom_path(position="jitter") ## End(Not run)