wilkelab / ggridges

Ridgeline plots in ggplot2
https://wilkelab.org/ggridges
GNU General Public License v2.0
412 stars 31 forks source link

How do I add the gradient color with variables other than x or y? #62

Open Byronxy opened 3 years ago

Byronxy commented 3 years ago

Hi I see example like this

ggplot(lincoln_weather, aes(x = `Mean Temperature [F]`, y = Month, fill = stat(x))) +
  geom_density_ridges_gradient(scale = 3, rel_min_height = 0.01) +
  scale_fill_viridis_c(name = "Temp. [F]", option = "C") +
  labs(title = 'Temperatures in Lincoln NE in 2016')

But I wish to use other variables (continous) to replace the x here, while it does not work

sohcahtoaster commented 3 years ago

I'm having the same issue- let us know if you found an answer!