Looks like the example for changing plot.background in theme function doesn't work properly, here is the code
z <- ggplot(mtcars, aes(wt, mpg, colour = factor(cyl))) + geom_point()
z + theme(plot.background = element_rect(fill = "green"))
I didn't see any change in the plot.
> sessionInfo()
R Under development (unstable) (2012-07-17 r59871)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=C LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] grid stats graphics grDevices utils datasets methods
[8] base
other attached packages:
[1] gtable_0.1.1 ggplot2_0.9.2
loaded via a namespace (and not attached):
[1] colorspace_1.1-1 compiler_2.16.0 dichromat_1.2-4 digest_0.5.1
[5] labeling_0.1 MASS_7.3-19 munsell_0.3 plyr_1.7.1
[9] proto_0.3-9.2 RColorBrewer_1.0-5 reshape2_1.2.1 scales_0.2.1
[13] stringr_0.6.1 tools_2.16.0