Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
472 views
in Technique[技术] by (71.8m points)

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

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: enter image description here

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: enter image description here

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...