How to change colors in boxplot in R?
1
0
Entering edit mode
2.0 years ago
Amr ▴ 180

How to change colors in boxplot in R?

I want to change the colors of the cage parameters for example make cage1 in color, cage2 in different color etc.

plot_richness(physeq.alpha,x ='cage' ,col = 'cage', measures=c("Chao1","Shannon",'simpson','invsimpson','ACE')) + geom_boxplot(fill = c('red','blue','orange','purple','yellow'),color = 'darkgreen') +
  scale_fill_manual(values=palette)

enter image description here

ggplot2 box-plot • 1.2k views
ADD COMMENT
0
Entering edit mode
2.0 years ago
LDT ▴ 340

The cage parameter was plotted with geom_point. I think you need to change the colors inside geom_point.

Something like

geom_point(aes(x=cage,y=alpha_diversity, color=cage) +
scale_color_manual(values=c("color1,color2,colour3))

If you post a reproducible example, I can post more info. If this does not help I can try create one and post it later

ADD COMMENT

Login before adding your answer.

Traffic: 1809 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6