Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

Graphics Parameters

The par function in R applies various options to the current graphics device. It can not be set until the device has been created. It is used to change or add to the appearance of a plot, or to obtain information about a plot. For example, the usr option returns the coordinates of the plotting region:

> plot(rnorm(50))
> par("usr")
[1] -0.960000 51.960000 -3.245599  2.852000

This is useful when you want to place additional objects on the plot--it will tell you the extent of the coordinates currently in use.

When using the lattice package note that instead of par we use trellis.par.get and trellis.par, as in:

> library(lattice)
> mt <- trellis.par.get("par.main.text")
> mt$cex <- 0.7
> trellis.par.set("par.main.text", mt)

The output of trellis.par.get without arguments lists all the possible options. Calling show.settings can also help.



Subsections

Copyright © 2004-2006 Graham.Williams@togaware.com
Support further development through the purchase of the PDF version of the book.
Brought to you by Togaware.