I am trying to color some joyplots a specific set of colors. However, when I use the following code:
ggplot(data=data, aes(x=x, y=y, fill=color))+
geom_density_ridges(scale=1.5)+
theme_joy()+
ylab("")+
labs(fill="")
where 'color' is a text vector in my data frame, I get output that fills the plots with the automatic colors, not the ones specified in my vector.
When I try to modify the code to manually assign colors values as follows:
ggplot(data=data, aes(x=x, y=y, fill=c("red", "black", "blue")))+
geom_density_ridges(scale=1.5)+
theme_joy()+
ylab("")+
labs(fill="")
I get the following error: Aesthetics must be either length 1 or the same as the data (103): fill
What is going on here? When I specify that the fill should be the color vector I get automatic colors, and when I try to manually implement the colors I am getting an error that my specification doesn't match the vector length.
How can I get the colors I want? Not sure what I am missing here?
Thanks for any assistance.