vector of measurements for plotting on left y axis.
y2
optional vector of measurements for plotting on right y axis.
labels
character vector containing labels for x, y1 and y2.
y2par
optional named list of par arguments to format the y2 axis.
add
logical flag to specify if a new plot (with axes etc) is to be
drawn (FALSE) or an existing plot is to be added to (TRUE).
xy
optional list to pass usr and usr2 (see Value).
xlegend
position for legend.
inset
inset for legend.
…
optional par arguments.
Value
Returns the list
usr
par('usr') for y1 axis
usr2
par('usr') for y2 axis
In addition the variable
.par.usr2, equal to usr2, is created in globalenv().
Details
y2plot draws up to two superimposed plots, one with the y axis on the left
and the other on the right, with suitable adjustment for par('mar')
and including a legend. The format for y1 is controlled by par arguments,
and that for y2 by the list y2par.
# NOT RUN {## plot boys median height and weight on the UK 1990 referencewith(uk90[uk90$sex == 1,],
y2plot(x=years, y1=M.ht, y2=M.wt, y2par=list(col='red'))
)
# }