Learn R Programming

ggjoy (version 0.1)

geom_joy2: Create joyplot based on closed polygons

Description

`geom_joy2` is virtually identical to `geom_joy` but draws closed polygons rather than ridgelines.

Usage

geom_joy2(mapping = NULL, data = NULL, stat = "joy", na.rm = FALSE,
  show.legend = NA, inherit.aes = TRUE, ...)

Arguments

Examples

Run this code
# NOT RUN {
ggplot(iris, aes(x=Sepal.Length, y=Species, group=Species)) +
  geom_joy2() +
  scale_y_discrete(expand=c(0.01, 0)) +
  scale_x_continuous(expand=c(0.01, 0)) +
  theme_joy()


# set the scale argument in `geom_joy2()` to determine how much overlap there is among the plots
ggplot(diamonds, aes(x=price, y=cut, group=cut)) +
  geom_joy2(scale=4) +
  scale_y_discrete(expand=c(0.01, 0)) +
  scale_x_continuous(expand=c(0.01, 0)) +
  theme_joy()
# }

Run the code above in your browser using DataLab