How to add texture to fill colors in ggplot2

前端 未结 8 1365
误落风尘
误落风尘 2020-11-22 08:30

I\'m currently using scale_brewer() for fill and these look beautiful in color (on screen and via color printer) but print relatively uniformly as greys when us

8条回答
  •  没有蜡笔的小新
    2020-11-22 09:29

    ggplot can use colorbrewer palettes. Some of these are "photocopy" friendly. So mabe something like this will work for you?

    ggplot(diamonds, aes(x=cut, y=price, group=cut))+
    geom_boxplot(aes(fill=cut))+scale_fill_brewer(palette="OrRd")
    

    in this case OrRd is a palette found on the colorbrewer webpage: http://colorbrewer2.org/

    Photocopy Friendly: This indicates that a given color scheme will withstand black and white photocopying. Diverging schemes can not be photocopied successfully. Differences in lightness should be preserved with sequential schemes.

提交回复
热议问题