Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

position_points_sina

Randomly distribute points in a ridgeline plot between baseline and ridgeline


Description

This is a position adjustment specifically for geom_density_ridges() and related geoms. It only jitters the points drawn by these geoms, if any. If no points are present, the plot remains unchanged. The effect is similar to a sina plot: Points are randomly distributed to fill the entire shaded area representing the data density.

Usage

position_points_sina(rel_min = 0.02, rel_max = 0.98, seed = NULL)

Arguments

rel_min

The relative minimum value at which a point can be placed.

rel_max

The relative maximum value at which a point can be placed.

seed

See position_points_jitter.

See Also

Other position adjustments for ridgeline plots: position_points_jitter, position_raincloud

Examples

library(ggplot2)

ggplot(iris, aes(x = Sepal.Length, y = Species)) +
  geom_density_ridges(jittered_points = TRUE, position = "points_sina", alpha = 0.7)

ggridges

Ridgeline Plots in 'ggplot2'

v0.5.3
GPL-2 | file LICENSE
Authors
Claus O. Wilke [aut, cre] (<https://orcid.org/0000-0002-7470-9261>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.