Learn R Programming

ggjoy (version 0.3.0)

theme_joy: A custom theme specifically for use with joyplots

Description

This theme has some special modifications that make joyplots look better, such as properly aligned y axis labels. It can draw plots with and without background grids (see examples).

Usage

theme_joy(font_size = 14, font_family = "", line_size = 0.5,
  grid = TRUE)

Arguments

font_size

Overall font size. Default is 14.

font_family

Default font family.

line_size

Default line size.

grid

Boolean indicating whether a background grid should be drawn (TRUE) or not (FALSE).

Value

The theme.

Examples

Run this code
# NOT RUN {
# Example with background grid
ggplot(iris, aes(x = Sepal.Length, y = Species, group = Species)) +
  geom_joy(rel_min_height = 0.005) +
  scale_y_discrete(expand = c(0.01, 0)) +
  scale_x_continuous(expand = c(0.01, 0)) +
  theme_joy()

# Example without background grid
ggplot(iris, aes(x = Sepal.Length, y = Species, group = Species)) +
  geom_joy() +
  scale_y_discrete(expand = c(0.01, 0)) +
  scale_x_continuous(expand = c(0.01, 0)) +
  theme_joy(grid = FALSE)

# }

Run the code above in your browser using DataLab