change line color in ggridges

Jellz

How to change the line color or shape in a ggridge density plot?

ggplot(iris, aes(x = Sepal.Length, y = Species)) +
  geom_density_ridges2() +
  scale_y_discrete(expand = c(0.01, 0)) +
  scale_x_continuous(expand = c(0.01, 0)) +
  theme_ridges()

enter image description here

Quinten

I am not sure what you exactly want, but change the color of your lines can be done by using color in your geom_density_ridges2 function like this:

library(tidyverse)
library(ggridges)
ggplot(iris, aes(x = Sepal.Length, y = Species)) +
  geom_density_ridges2(color = "red") +
  scale_y_discrete(expand = c(0.01, 0)) +
  scale_x_continuous(expand = c(0.01, 0)) +
  theme_ridges()

Output:

enter image description here

As you can see, the color of the lines is changed to red.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related