Is it possible to give every variable a different color and how?
I would like to keep the legend.
Please note that it is made with ggerrorplot function.
Is it possible to give every variable a different color and how?
I would like to keep the legend.
Please note that it is made with ggerrorplot function.
You can use a different palette in your ggerrorplot function. I will use the ToothGrowth dataset as an example:
the color palette to be used for coloring or filling by groups. Allowed values include "grey" for grey color palettes; brewer palettes e.g. "RdBu", "Blues", ...; or custom color palette e.g. c("blue", "red"); and scientific journal palettes from ggsci R package, e.g.: "npg", "aaas", "lancet", "jco", "ucscgb", "uchicago", "simpsons" and "rickandmorty".
For example use palette="Paired" for blue color:
df<- ToothGrowth
library(ggpubr)
ggerrorplot(df, x = "dose", y = "len",
color = "supp", palette = "Paired",
error.plot = "pointrange",
position = position_dodge(0.5))
Output:
Or palette="npg":