image.legend(zmat, x=<<see below>>, y=<<see below>>, size=c(1, 1), horizontal=T, nint=50)
z
.
This should be the matrix that is represented in the image.
Missing values (NA) are allowed.
x
and
y
are of length
1
, they determine the upper left corner of the legend scale;
if they are vectors of length
2
, they specify opposite corners of the
legend scale.
A list containing
x
and
y
values may be supplied instead (as
x
).
If
x
is missing, a call to the
locator
function is made to determine the
placement (and size, see below).
size
and
x
are both missing, you are required to enter two points on the
existing plot (with
locator
) to specify the opposite corners
of the legend scale.
TRUE
, the orientation of the image legend is horizontal.
The size specified includes the image scale and the surrounding box only; the tick marks and axis labels are outside this region.
# put up an image plot, then put up a horizontal legend i <- interp(ozone.xy$x, ozone.xy$y, ozone.median) image(i) image.legend(i) # add a vertical legend with a specific location rx <- range(ozone.xy$x) ry <- range(ozone.xy$y) image(i) # draw boundaries in the background color usa(xlim=rx, ylim=ry, add=T, col=0) # draw dashed lines to ensure the lines are visible everywhere usa(xlim=rx, ylim=ry, add=T, lty=2) image.legend(i$z, x=-74.7, y=43.3, size=c(.5, 1.5), hor=F) title(main="Median Ozone Concentrations in the North East")