geometry_jitter: Jitter geometries to avoid overplotting.

Description Usage Arguments Details Examples

Description

Jitter adds random uniform offsets to avoid overplotting.

Usage

1
geometry_jitter(geom, x = NULL, y = NULL)

Arguments

geom

A geometry data frame.

x,y

amount to jitter in x and y directions. In most cases, defaults to 40% of the resolution of the data.

Details

Jittering differs a little depending on the underlying geometry:

point,path,polygon,text

Jitters both x and y.

ribbon

Jitters y1 & y2 by same amount

rect

Jitters x1 & x2, and y1 & y2 by same amount - the height and width stay the same.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
scatter_ex %>%
 plot() %>%
 geometry_jitter() %>%
 plot(add = TRUE, col = "red")

# Can override amount of jitter
scatter_ex %>%
 plot() %>%
 geometry_jitter(0.2, 0.2) %>%
 plot(add = TRUE, col = "red")

rstudio/gggeom documentation built on May 28, 2019, 4:35 a.m.