Monday, February 11, 2013

How to save a plot in R

To save a plot (e.g. plot(x,y)) in R type the following.

For a png:

> png('picture.png')
> plot(x,y)
> dev.off()


For a jpg:

> jpeg('picture.jpg')
> plot(x,y)
> dev.off()

No comments:

Post a Comment