我想在ggplot图例中获得一个符号而不在比例中指定。
我想要这个:
df <- data.frame(a=1:5, b=factor(1:5, labels=c(1:4, "\u2265 5")), c=10:14)
ggplot(df, aes(a,c, color=b)) + geom_point()
产生这个情节
制作这样的情节:
ggplot(df, aes(a,c, color=b)) + geom_point() + scale_color_brewer(labels=c(1:4, "\u2265 5"))
这可能吗?
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: i386-w64-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United Kingdom.1252
[2] LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] ggplot2_1.0.0
loaded via a namespace (and not attached):
[1] colorspace_1.2-4 digest_0.6.4 grid_3.1.2
[4] gtable_0.1.2 labeling_0.3 MASS_7.3-35
[7] munsell_0.4.2 plyr_1.8.1 proto_0.3-10
[10] RColorBrewer_1.0-5 Rcpp_0.11.3 reshape2_1.4
[13] scales_0.2.4 stringr_0.6.2 tools_3.1.2