我正在尝试在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())

但是,该图例看起来有些困惑(不像我看到的所有其他示例):

我在做什么错?
> 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

最佳答案

稳定的ggplot2_0.9.0reshape2_1.2.1 CRAN版本看起来不错
也许您可以报告错误here

关于r - y传奇ggplot2,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9524929/

10-12 17:05