在ggplot图例,Windows远程桌面中缺少颜色条 [英] Color bar missing in ggplot legend, Windows Remote Desktop

查看:193
本文介绍了在ggplot图例,Windows远程桌面中缺少颜色条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows机器上运行R版本3.0.1和ggplot2版本0.9.3.1,并从彩条传说中获取异常行为 - 图例标签出现,但颜色条神奇地没有。



例如,如果我运行以下代码:

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

我得到这个图:

然而在我的另一台机器上(运行R版本2.15.2和ggplot 0.9.3.1的Mac)代码给了我这个:



行为似乎只适用于连续数值变量的颜色条 - 离散因子的图例按预期显示。我试过重新安装ggp​​lot2。任何人都有想到这里发生了什么?感谢!

解决方案

我发现了这个问题,并提供了一个工作解决方案,这里。这是通过远程桌面访问服务器时的颜色呈现问题,可以在主机设置中修复。


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.

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:

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. 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.

这篇关于在ggplot图例,Windows远程桌面中缺少颜色条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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