position_spread: Spread Overlapping Grobs Spread overlapping groups by...

Description Usage Arguments Examples

Description

Spread Overlapping Grobs Spread overlapping groups by shrinking them to fit within the data's y range.

Usage

1
position_spread(height = NULL, reverse = FALSE, padding = 0.2)

Arguments

height

One of total (default), panel, single, a numeric scalar value to give all geoms equal space, or a numeric vector the length of panels*groups for manually specifying the height of each group.

reverse

Reverse the order of segments within overlapping y ranges.

padding

Multiple of height. Will shrink/enlarge groups to fit within a region.

Examples

1
2
3
4
5
6
library(ggplot2)

x <- data.frame(y = rnorm(1000), x="", myGroup=sample(1:3, 1000, TRUE))

ggplot(x, aes(x, y))+
geom_point(aes(group=myGroup), position=position_spread(height = 0.5))

iamamutt/ggdistribute documentation built on May 8, 2019, 3:12 a.m.