Plot Manipulations

Adding Features       Colors       Layout / Multiple Plots       Saving Plots       Main Menu

Adding Features

axisboxexpression
grididentifylegend
locatormtextpar("usr")
"plotmath" (help only)strwidthtext
title

Colors

brewer.pal (RColorBrewer)cm.colorscol2rgb
colorsgrayheat.colors
hsvpaletterainbow
rgbterrain.colorstopo.colors

Layout / Multiple Plots

Note that you can have multiple plot windows open through win.graph() (Windows) or x11() and choose a window with dev.set(). This is different than multiple plots on 1 window, like with mfrow or layout

dev.setframegrid.layout (grid)
layoutpar(mfrow=c(nrow,ncol))plot.window
screentrellis.devicewin.graph
x11

Saving Plots

To use many of these functions,you call the function, then give plot commands, and then turn off the device with dev.off. For post-saving use savePlot or equivalently the GUI option under the File Menu.

Note that if you are plotting an extremely large number of points, that postscript and pdf will save each point and take a long time to print or even to pull up on the computer. Using jpeg, which just saves a picture of the end plot, will be much faster.

pdf and postscript can save multiple plots in one file. For jpeg, you can use %d to iteratively add a number to the file name so that you can save a series of plots to successive files with one device call. You can then view them as a "slideshow" to look through them quickly.

For example:
jpeg("C:\\MyFiles\\Hist\\Page%dHist.jpg")
for(i in 1:20){plot(x[,i],y[,i])}
dev.off()

bmpdev.offjpeg
pdfpostscriptrecordPlot
replayPlotsavePlot