> X11() # Opens the graphics window > plot(rnorm(10),rnorm(10))in either R or S-plus. Similarly, we could use motif() instead of X11(). To close the graphics device, type dev.off() at the prompt and the device will exit.
In addition, one can create a postscript file (or encapsulated postscript) for inclusion in a paper or presentation by opening the postscript graphics device. To save a histogram of 1000 random normals .eps file, issue the commands
> postscript("normals.eps") # in S-plus
> hist(rnorm(1000))
> dev.off()
and the file normals.eps is created in your current working directory. Note that the file is not created until you turn the postscript device off using the dev.off() command. In R, you need to specify the paper size as ``letter'' in the postscript command above.
> postscript("normals.eps", paper=''letter'')