position_jitter {ggplot2}R Documentation

position_jitter

Description

Jitter points to avoid overplotting

Usage

position_jitter(width=NULL, height=NULL, ...)

Arguments

width degree of jitter in x direction. Defaults to 40% of the resolution of the data.
height degree of jitter in y direction. Defaults to 40% of the resolution of the data.
... other arguments

Details

This page describes position_jitter, see layer and qplot for how to create a complete plot from individual components.

Value

A layer

Author(s)

Hadley Wickham, http://had.co.nz/

See Also

Examples

## Not run: 
qplot(am, vs, data=mtcars)

# Default amount of jittering will generally be too much for 
# small datasets:
qplot(am, vs, data=mtcars, position="jitter")
# Control the amount as follows
qplot(am, vs, data=mtcars, position=position_jitter(w=0.1, h=0.1))

# The default works better for large datasets, where it will 
# will up as much space as a boxplot or a bar
qplot(cut, price, data=diamonds, geom=c("boxplot", "jitter"))
## End(Not run)

[Package ggplot2 version 0.8.2 Index]