R Change ggplot geom_quasirandom colors

819 Views Asked by At

R newbie on deck, Hi everybody !

I wrote a code to visualize a geom_quasirandom (library GGbeeswarm ) for my dataset. What works is to visualize it, but with 3 random colors for the 3 species in the dataset. However, i do want to customize the colors of those 3 to my own specific. But its not working and i dont know how to adjust my code.

My dataset is the "palmer penguins". Code is:

ggplot(penguins, aes(sex, body_mass_g, color = species)) +
  geom_quasirandom() +
  scale_fill_manual(values = c(Chinstrap = "#C35CCA", Gentoo = "#0F7075", Adelie = "#FF8305")) +
  labs(x = "Sex", y = "Bodymass", title = "Penguins bodymass by gender")

Thanks in advance !

0

There are 0 best solutions below