Position adjustments are used to adjust the position of each geom. The following position adjustments are available:
To set the position adjustment of a geom, use the position parameter of the layer()
function:
layer(geom="point", ..., position="jitter")
Or use the position parameter of the geom_...()
function:
geom_point(..., position="jitter")
All existing position adjustments have two arguments: "width" and "height". ggplot2 determines sensible default values for these arguments. However, in some situations you may want to override these defaults (e.g. to disable jittering along one axis). To specify the arguments when setting a position adjustment, use the position_...(...)
function to create a position adjustment.
layer(geom="point", ..., position=position_jitter(width=0, height=0.1))
or
geom_point(..., position=position_jitter(width=0, height=0.1))