Learn R Programming

ggridges (version 0.5.0)

scale_vline: Scales for vline aesthetics

Description

These are various scales that can be applied to vline aesthetics, such as vline_color, vline_size, vline_linetype. The individual scales all have the same usage as existing standard ggplot2 scales, only the name differs.

scale_vline_linetype(): Equivalent to scale_linetype().

scale_vline_size_continuous(): Equivalent to scale_size_continuous().

scale_vline_color_hue(): Equivalent to scale_colour_hue().

scale_vline_color_gradient(): Equivalent to scale_colour_gradient(). Note that this scale cannot draw a legend, however, because of limitations in guide_colorbar().

Arguments

See Also

See scale_point_color_hue() for specific scales for point aesthetics and scale_discrete_manual() for a general discrete scale.

Examples

Run this code
# NOT RUN {
library(ggplot2)

# default scales
ggplot(iris, aes(x=Sepal.Length, y=Species, fill = Species, color = Species)) +
  geom_density_ridges(aes(vline_color = Species, vline_linetype = Species),
                      alpha = .4, quantile_lines = TRUE) +
  theme_ridges()

# modified scales
ggplot(iris, aes(x=Sepal.Length, y=Species, fill = Species, color = Species)) +
  geom_density_ridges(aes(vline_color = Species),
                      alpha = .4, quantile_lines = TRUE) +
  scale_fill_hue(l = 50) +
  scale_vline_color_hue(l = 30) +
  theme_ridges()
# }

Run the code above in your browser using DataLab