After making a figure in ggplot
and using a viridis
palette, I would like to get a list of Hex color codes for all colors which were randomly selected for that particular plot. Is that possible?
Here is the data:
df = data.frame(Cell = c(rep("13a",5), rep("1b",5), rep("5b",5)),
condition = rep(c("a","b","c","d","e"), 3),
variable = c(58,55,36,29,53, 57,53,54,52,52, 45,49,48,46,45))
And the plot:
library(ggplot2)
library(viridis)
windows(width=4, height=4 )
ggplot(df, aes(x = condition, y = variable, group = Cell, color = Cell)) +
geom_point(aes(color = Cell))+
geom_line()+
scale_color_viridis(discrete=TRUE)