image.legend(zmat, x=<<see below>>, y=<<see below>>, size=c(1, 1), horizontal=T, nint=50)
Graphical parameters may also be supplied as arguments to this function (see par).
# put up an image plot, then put up a horizontal legendi <- 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")