ggplot中填充/ geom_tile的图例问题

时间:2014-03-15 18:35:56

标签: r ggplot2

我正在使用geom_tile,并且发现了图例如何显示的错误。运行此代码:

library(ggplot2)
set.seed(0)

DT = data.frame(x = rep(letters[1:3], each = 3), y = rep(letters[1:3], by = 3), value = rnorm(9))

g = ggplot(DT, aes(x = x, y = y, fill = value)) + geom_tile()
print(g)

为图例生成一个带有空白颜色条的图表(我目前无法发布该图表,因为我没有足够的图像声誉)。

运行R.Version()给出:

$platform
[1] "x86_64-w64-mingw32"

$arch
[1] "x86_64"

$os
[1] "mingw32"

$system
[1] "x86_64, mingw32"

$status
[1] ""

$major
[1] "3"

$minor
[1] "0.2"

$year
[1] "2013"

$month
[1] "09"

$day
[1] "25"

$`svn rev`
[1] "63987"

$language
[1] "R"

$version.string
[1] "R version 3.0.2 (2013-09-25)"

$nickname
[1] "Frisbee Sailing"

任何帮助表示赞赏!

0 个答案:

没有答案