简体   繁体   English

ggplot图例,Windows Remote Desktop中缺少颜色栏

[英]Color bar missing in ggplot legend, Windows Remote Desktop

I'm running R version 3.0.1 and ggplot2 version 0.9.3.1 on a Windows machine and getting aberrant behavior from color bar legends -- the legend labels appear but the color bar mysteriously does not. 我在Windows机器上运行R版本3.0.1和ggplot2版本0.9.3.1,并从颜色栏图例中获得异常行为-出现了图例标签,但颜色栏却神秘地没有。

For example, if I run the following code: 例如,如果我运行以下代码:

d <- data.frame(x=rnorm(100), y=rnorm(100), z=rnorm(100))
ggplot(d, aes(x, y, color=z)) + geom_point()

I get this plot: 我得到这个情节: 在此处输入图片说明

whereas on my other machine (a Mac running R version 2.15.2 and ggplot 0.9.3.1) the same code gives me this: 而在我的另一台机器(运行R版本2.15.2和ggplot 0.9.3.1的Mac上)上,相同的代码给出了以下信息: 在此处输入图片说明

The behavior seems to apply only to color bars for continuous numerical variables -- legends for discrete factors appear as expected. 该行为似乎仅适用于连续数值变量的色条-离散因子的图例如预期般出现。 I've tried reinstalling ggplot2. 我试过重新安装ggp​​lot2。 Anybody have thoughts on what's going on here? 有人对这里发生的事情有想法吗? Thanks! 谢谢!

I found the problem, and a working solution, here . 我在这里找到了问题和可行的解决方案。 It's an issue with color rendering when accessing a server via Remote Desktop, and can be fixed in host settings. 通过远程桌面访问服务器时,色彩渲染存在问题,可以在主机设置中解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM