ggplot2 2.0.0中的geom_point边界 [英] geom_point borders in ggplot2 2.0.0

查看:843
本文介绍了ggplot2 2.0.0中的geom_point边界的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在最近的 ggplot2 版本中,改变似乎是以 geom_point 的方式进行的例如,如果我试图做alpha阴影,那么我得到以下外观:

<$ p



$ p $ library(ggplot2)

ggplot(mtcars)+
geom_point(aes(wt,qsec),
size = 8,
stroke = 0,
alpha = .3)



如何获得 ggplot 以模仿其早先的行为,任何边界?

编辑:

正如我所说,这是发生在:


最近版本的 ggplot2




 > sessionInfo()
R版本3.2.3(2015-12-10)
平台:x86_64-w64-mingw32 / x64(64位)
在Windows下运行> = 8 x64 (build 9200)

区域设置:
[1] LC_COLLATE =英语_美国1252 LC_CTYPE =英语_美国1252 LC_MONETARY =英语_美国1252 LC_NUMERIC = C
[5] LC_TIME = English_United States.1252

附加软件包:
[1] stats graphics grDevices utils数据集方法库

其他附加软件包:
[1] ggplot2_2.0.0

通过命名空间加载(并未附加):
[1] labels_0.3 colorspace_1.2-6 scales_0.3.0 plyr_1.8.3 tools_3.2.3 gtable_0.1.2 Rcpp_0。 12.2 grid_3.2.3 munsell_0.4.2

编辑2



这些边界也出现在github版本中: ggplot2_2.0.0.9000

解决方案

在发给ggp的电子邮件中lot2 listserve,Hadley提到geom_point()现在使用形状19而不是16.这在默认的Linux图形设备上看起来好多了。 (它比旧点稍微小一些,但不应该对任何图形有显着影响)。

  library(ggplot2) 
ggplot(mtcars)+
geom_point(aes(wt,qsec),
size = 8,
stroke = 0,
shape = 16,
alpha = .3)


In the most recent verion of ggplot2, a change appears to have been made in the way that geom_point is rendered.

For instance, if I attempt to do alpha shading, then I get the following appearance:

library(ggplot2)

ggplot(mtcars) +
  geom_point(aes(wt, qsec),
            size  = 8,
            stroke = 0,
            alpha = .3)

How can I get ggplot to mimic its earlier behavior, and have the points appear without any border?

Edit:

As I said, this is occurring in:

the most recent version of ggplot2

> sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

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

other attached packages:
[1] ggplot2_2.0.0

loaded via a namespace (and not attached):
[1] labeling_0.3     colorspace_1.2-6 scales_0.3.0     plyr_1.8.3       tools_3.2.3      gtable_0.1.2     Rcpp_0.12.2      grid_3.2.3       munsell_0.4.2   

Edit 2:

These borders also occur in the github version: ggplot2_2.0.0.9000

解决方案

In an email to the ggplot2 listserve, Hadley mentions "geom_point() now uses shape 19 instead of 16. This looks much better on the default Linux graphics device. (It’s very slightly smaller than the old point, but it shouldn’t affect any graphics significantly)."

library(ggplot2)
ggplot(mtcars) +
  geom_point(aes(wt, qsec),
             size  = 8,
             stroke = 0,
             shape=16,
             alpha = .3)

这篇关于ggplot2 2.0.0中的geom_point边界的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆