| zipfR.legend {zipfR} | R Documentation |
zipfR.legend is a thin wrapper around the standard
legend function, helping to place the legend box in one
of the corners of the screen without knowing the precise coordinate
ranges in use.
Fine control over the placement of the legend box is possible with the
optional arguments margin.x and margin.y.
zipfR.legend is used internally by the high-level plotting
functions plot.spc and plot.vgc.
zipfR.legend(corner, margin.x=.05, margin.y=margin.x,
legend=NULL, bg="white", ...)
corner |
an integer specifying the corner in which to place the legend box (1 = top left, 2 = top right, 3 = bottom right, and 4 = bottom left) |
margin.x |
distance of the legend box from the border of the plotting region along the x-axis, as a fraction of the width of the plotting region (default: 5%) |
margin.y |
distance of the legend box from the border of the
plotting region along the y-axis, as a fraction of the height of the
plotting region. Defaults to the same value as margin.x, so
in most cases it is sufficient to specify margin.x in order
to move the legend box towards a corner or away from the corner. |
legend |
a character or expression vector specifying the legend
text (passed on to legend |
bg |
background colour of the legend box. Defaults to
"white", so parts of the plot behind the box are hidden. |
... |
further arguments are passed on to the legend
function and can be used to specify line styles, plot symbols and/or
fill styles for the legend entries |
legend for details on how to specify legend entries.
Most of the options documented there can also be used with
zipfR.legend.
plot.spc, plot.vgc and
zipfR.plotutils for more information about graphics
functions in zipfR
## zipfR.legend() can be used with all standard plots as well ## Not run: plot(sin, 0, 2*pi) ## Not run: zipfR.legend(2, margin.x=.1, legend="Some silly legend")