position_jitter {ggplot2}R Documentation

position_jitter

Description

Jitter points to avoid overplotting

Usage

position_jitter(xjitter=NULL, yjitter=NULL, ...)

Arguments

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

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)
    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)

[Package ggplot2 version 0.6 Index]