Alex Rivera | Logout

Recommendations for black and white color scheme with ggplot2

Asked 2011-05-12T16:56:55.350
24

I'm using ggplot2 to produce many diagrams structured like this:

enter image description here

Is there an easy of producing something that looks good in black and white? I did read this question but it still is producing a colored fill.

Edit
Report

1 Answer

36

I am not sure if color really helps in this graph, since it is already clear what each boxplot corresponds to. However, if you still need to color this in black and white, you can achieve it using scale_fill_grey. Here is an example

library(ggplot2)
data(tips)
p0 = qplot(day, tip/total_bill, data = tips, geom = 'boxplot', fill = day) + 
  scale_fill_grey()
print(p0)

This produces the output shown below enter image description here

answered 2011-05-12T17:11:29.333

Your Answer