4. Devices
device is "graphics destination": a window, or a file
Must be created and closed
win.graph(); X11() # window
pdf(); postscript(); svg(); # vector-graphics file (preferred)
png(); jpeg(); tiff() # bitmap file (for speed)
dev.off() # write the file
Multiple can exist at the same time, output goes to active device
dev.list(); dev.set()
6. plot()
plot() is a generic function, see ?plot.default for help
Common arguments: main; x/ylab; x/ylim; type; pch; cex; col; lty; lwd
> x <- -100:100
> plot(x, x^2)
8. plot()
plot() is a generic function, see ?plot.default for help
Common arguments: main; x/ylab; x/ylim; type; pch; cex; col; lty; lwd
Many graphics aspects are controlled by par(), the graphics context
See ?par for meaning of additional parameters passed as '...'
Change with par(key1=value1, key2=value2, ...)
Common parameters:
cex.{main,lab,etc} # character scaling
mar # margin sizes
pty # "s" for square plots; "m" otherwise
mfrow(c(2,3)) # plotting several panels