plot.background doesn't work in 0.9.2

44 views
Skip to first unread message

Tengfei

unread,
Sep 6, 2012, 12:44:34 AM9/6/12
to ggp...@googlegroups.com
Dear all,

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.

Do I miss anything?

Thanks

Tengfei

> 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 

Winston Chang

unread,
Sep 6, 2012, 1:10:28 AM9/6/12
to Tengfei, ggp...@googlegroups.com
Are you using the latest version from CRAN? This was a problem in the
initial 0.9.2 release candidate, but it has been fixed. That version
reported itself to be 0.9.2, even though it was just a release
candidate.

-Winston
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example:
> https://github.com/hadley/devtools/wiki/Reproducibility
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2

Tengfei Yin

unread,
Sep 6, 2012, 11:53:57 AM9/6/12
to Winston Chang, ggp...@googlegroups.com
Hi Winston,

Thanks a lot! It works after I updated to the latest version of ggplot2 0.9.2 on CRAN.

cheers

Tengfei
--
Tengfei Yin
MCDB PhD student
1620 Howe Hall, 2274,
Iowa State University
Ames, IA,50011-2274



Reply all
Reply to author
Forward
0 new messages