Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Washy legend ggplot2

Tags:

r

ggplot2

I am trying to use the new guides system in ggplot2:

require(devtools)    
dev_mode()   
install_github("ggplot2")
require(ggplot2)

require(reshape2)
p <- ggplot(melt(outer(1:4, 1:4)), aes(x=Var1, y=Var2)) + geom_tile(aes(fill=value))
p + guides(fill = guide_colorbar())

However the legend looks some kind of washy (not like all the other examples I have seen): enter image description here

What am I doing wrong?

> sessionInfo()
R version 2.14.1 (2011-12-22)
Platform: x86_64-pc-linux-gnu (64-bit)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8    LC_PAPER=C                 LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] reshape2_1.2.1  ggplot2_0.9.0   devtools_0.6    gridSVG_0.8-1   proto_0.3-9.2   rgeos_0.2-3     stringr_0.6     gpclib_1.5-1   
 [9] maptools_0.8-14 lattice_0.20-0  sp_0.9-95       foreign_0.8-49 

loaded via a namespace (and not attached):
 [1] colorspace_1.1-1   dichromat_1.2-4    digest_0.5.1       MASS_7.3-17        memoise_0.1        munsell_0.3       
 [7] plyr_1.7.1         RColorBrewer_1.0-5 RCurl_1.91-1       scales_0.2.0       tools_2.14.1
like image 515
EDi Avatar asked Oct 08 '22 12:10

EDi


1 Answers

Looks fine with the stable CRAN version of ggplot2_0.9.0 and reshape2_1.2.1 Maybe you could report the bug here.

Generated by ggplot 0.9.0

like image 59
Maiasaura Avatar answered Oct 12 '22 11:10

Maiasaura