Reputation: 8465
Is there a way to convert ggplot2
plots into black-and-white versions without rewriting much of their code, so that the black-and-white versions remain readable?
For instance, to replace scale_fill_gradient
with scale_fill_grey
? Or automatically make photocopy-friendly transformations as sites like http://colorbrewer2.org/ advise. (Unfortunately, textures are not an option, as ggplot2
doesn't support them.)
It's clearly possible with if ... else
and custom functions, but is there a more general solution?
Upvotes: 4
Views: 3073
Reputation: 70653
My second line in every ggplot figure I make is
theme_bw()
so
qplot(mpg, wt, data = mtcars) +
theme_bw()
Upvotes: 2