Home > database >  how can i change the color in ggplot?
how can i change the color in ggplot?

Time:01-11

I havehttps://i.stack.imgur.com/JRm2K.png a plot in R which produced with ggplot2, I want to change the color from the left side to the right side,https://i.stack.imgur.com/mOYVj.png. how can I change the color to a blue pallete? thank you

CodePudding user response:

I think you need to use a palette. Lots of examples here - one of which should suit your needs - https://www.sthda.com/english/wiki/ggplot2-colors-how-to-change-colors-automatically-and-manually

CodePudding user response:

Like the first comment on your question says it is a bit hard to help without any data and/or code example. Based on the question the best answer would probably be scale_fill_manual(). your boxplot code = bp

bp   scale_fill_manual(values=c("#999999", "#999999", "#999999", "#999999", "#999999", "#999999"))

Use a hexidecimal color map to find the colors you want and replace the 9's with the hexidecimal code you want.

  •  Tags:  
  • Related