I am looking for setting my own colors for on the below plot :
with the following part of code :
# Save PDF - Chisquare
pdf(file="Moschopoulos_Distribution.pdf")
color_curve <- c("red", "blue", "green", "grey", "black")
as.data.frame(y3) %>%
mutate(row = row_number()) %>% # add row to simplify next step
pivot_longer(-row) %>% # reshape long
mutate(name = recode(name, V1="z = 0.9595", V2="z = 1.087", V3="z = 1.2395", V4="z = 1.45", V5="z = 1.688")) %>%
ggplot(aes(value, color = name)) + # map x to value, color to name
geom_density() +
xlab(TeX("Distribution")) +
ylab("Number of occurences") +
ggtitle(TeX("Distribution of Ratio $(b_{sp}/b_{ph})^2$ for each redshift")) +
theme(plot.title = element_text(hjust = 0.5))
dev.off()
How could I set my own colors for each curve ?
I tried to do into code snippet above :
color_curve <- c("red", "blue", "green", "grey", "black")
ggplot(aes(value, color = color_curve)) +
but I get an error.