Reputation: 820
Can anyone tell me how to make graphics plotted interactively to an X11 device look as good as it does when saved to a file? For example, I scatter plot part of the diamonds
data set that comes with ggplot2 with:
library(ggplot2)
qplot(carat, price, data=diamonds, color=color, xlim=c(2,3), ylim=c(5000,10000))
ggsave("plot.png")
This is a screen shot of qplot()
-ing directly to an X11 device. If you zoom on the dots you'll see they are all different-shaped splotches:
and this is the same thing ggsave()
d to a png. The dots look like, well, dots:
I am on Ubuntu linux 14.04 with R 3.0.2, ggplot2 0.9.3.1-1, both installed via apt-get. I have cairodevice installed as well, if that makes a difference.
Upvotes: 1
Views: 1198
Reputation: 19960
If you indeed have cairo libraries and the Cairo
package installed the CairoX11
function should provide you the increased resolution.
require(Cairo)
CairoX11()
qplot(carat, price, data=diamonds, color=color, xlim=c(2,3), ylim=c(5000,10000))
Upvotes: 1