Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

addLegend

Add a Legend to a Plot Using Relative (0:1) Coordinates


Description

Place a legend in a plot using relative (0:1) coordinates.

Usage

addLegend(x, y, ...)

Arguments

x

x-axis coordinate in the range (0:1); can step outside.

y

y-axis coordinate in the range (0:1); can step outside.

...

arguments used by the function legend, such as lines, text, or rectangle.

Author(s)

Jon T. Schnute, Pacific Biological Station, Fisheries and Oceans Canada, Nanaimo BC

See Also

Examples

local(envir=.PBSmodEnv,expr={
  oldpar = par(no.readonly=TRUE)
  resetGraph()
  n <- sample(1:length(colors()),15); clrs <- colors()[n]
  addLegend(.2,1,fill=clrs,leg=clrs,cex=1.5)
  par(oldpar)
})

PBSmodelling

GUI Tools Made Easy: Interact with Models and Explore Data

v2.68.8
GPL (>= 2)
Authors
Jon T. Schnute [aut], Alex Couture-Beil [aut], Rowan Haigh [aut, cre], Nicholas Boers [ctb], Anisa Egeli [ctb], A. R. Kronlund [ctb], Steve Martell [ctb], Norm Olsen [ctb]
Initial release
2019-03-12

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.