plotWAC | R Documentation |
Convenience routine for plots
plotWAC( x, y = NA, col = "blue", xlab = "TIME [UTC]", ylab = "", lwd = 2, type = "l", lty = 1, logxy = "", pch = 20, cex = 1, legend.position = "bottomright", ... )
x |
Usually, Time from a data.frame; a vector of abscissa values. Optionally, a data.frame containing multiple variables to plot and superceding parameter y. |
y |
A vector of ordinate values for points to plot. If the first parameter is a data.frame, this argument is ignored. |
col |
Color to pass to plot (default: blue). Can be multiple values to set colors for multiple variables in data.frame mode. There are defaults ('blue', 'darkgreen', 'red', 'skyblue', 'darkorange') but values provided with this parameter precede that sequence of colors. |
xlab |
Label for the abscissa, to pass to plot (default: "TIME [UTC]") |
ylab |
Label for the ordinate, to pass to plot (default: "" or, for data.frame mode, first variable name) |
lwd |
Line width to pass to plot (default: 1); can be a vector |
type |
Plot type to pass to plot (default: "l") |
lty |
Line type to pass to plot (default: 1). Can be a vector for multiple variables provided in data.frame mode. |
logxy |
Set to 'y' for log axes. This is provided (vs log='y') because it makes possible translation of axis labels to 10^i format. |
pch |
Character number to use for scatterplots. Ignored if plot type is 'l'. |
cex |
Character size to use for scatterplots. Ignored if plot type is 'l'. |
legend.position |
For multiple-line calls with a data.frame, this parameter specifies the position for the legend. The default is 'bottomright'. The legend can also be suppressed by setting this parameter to NA. Then a legend can still be added after the plotWAC call. |
... |
Additional arguments to pass to plot(), but don't include col, xlab, ylab, lwd, type, xaxt or yaxt |
Sets some plot defaults and calls plot and axis. For a data.frame argument, sets plot limits to cover range of all variables in the data.frame.
William Cooper
plotWAC (RAFdata[, c("Time", "ATX", "DPXC")], legend.position="right") plotWAC (subset (RAFdata,, c(Time, TASX, GGVNS)), legend.position='topright') ## Not run: with(RAFdata, plotWAC (Time, TASX, ylab="TAS")) ## Not run: with(RAFdata, plotWAC (Time, PSXC, lty=2, ylab='ambient pressure [hPa]')) ## Not run: plotWAC (RAFdata[, c("Time", "PSXC")]) ## Not run: plotWAC (subset (RAFdata, ATX > -35, c(Time,ATX,DPXC))) ## Not run: plotWAC (Rsubset (RAFdata, Var=c('ATX', 'DPXC')))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.