R ggplot2 - no background or grid lines in plot with RGui
I'm having a strange problem with the output window in RGui (under Win XP). I should see a plot like the one below...
... when I run this script:
library(ggplot2)
x <- rnorm(100,0,1)
y <- rnorm(100,0,1)
z <- data.frame(开发者_Go百科x,y)
g <- ggplot(z, aes(x,y)) + geom_point() + theme_gray()
Instead, in the plot window it shows a white background and white grid lines, like below.
R Plot Window
When I export the plot to .png and I "preview" it in windows explorer - it doesn't show a background or grid lines.
Png in Windows
Same Png in Gimp
Same Png uploaded to image hosting
Any ideas about what's going on? How can I get the plot to display correctly in RGui?
Sounds like a problem with the device rather than R, try reinstalling GTK+. If that doesn't work try plotting jpegs instead of png's if you can.
精彩评论