legend.grid | R Documentation |
Draw a legend for a draw.grid
plot
legend.grid(x, y = NULL, breaks, col ,digits = 2, suffix = "", type = 1, pch = 15,
pt.cex = 2.5, bg = "lightblue", ...)
x, y |
the x and y co-ordinates to be used to position the legend. |
breaks |
a vector of breakpoints for the colours, must give one more breakpoint than colour. |
col |
a vector with colours. defaults to colors ranging from white (lowest) through yellow and orange to red (highest). |
digits |
integer indicating the number of significant places to be used in the legend. Defaults to 2. |
suffix |
character string to be placed after the legend entries, e.g. |
type |
integer specifying the legend type, |
pch |
plotting character, i.e., symbol to use. This can either be a single character or an integer code for one of a set of graphics symbols. See |
pt.cex |
character expansion of the symbols. Defaults to 2.5 |
bg |
background colour for the legend box |
... |
other arguments to be passed to |
Hans Gerritsen
draw.grid
data(coast)
data(landings)
byx = 1
byy = 0.5
xlim <- c(-15.5,0)
ylim <- c(50.25,56)
grd <- make.grid(landings$Lon,landings$Lat,landings$LiveWeight, byx, byy, xlim, ylim)
breaks <- breaks.grid(grd,zero=FALSE)
basemap(xlim, ylim, main = "Gadoid landings")
draw.grid(grd,breaks)
draw.shape(coast, col="darkgreen")
legend.grid("topright", breaks=breaks/1000, type=2, inset=0.02, title="tonnes")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.