[S] image and image.legend

Laura Richards (l.richards@niwa.cri.nz)
Fri, 24 Apr 1998 13:06:14 1200


Hi S-Plus users,

I am using version 3.4 for Unix.

I am trying to place a legend on an image plot, using image.legend,
in a multiple plot layout (other plots are time series, contour, and
persp). When I use locator to choose where I want image.legend to
place the legend bar, I get "error in image: image is not within
current plot region" or else "error in subplot (x = x, y = y, size =
size, fun = ..: subplot out of bounds" and the query gets dumped.

The following is the portion of code specifying call to image and
image.legend -

image(interp.density, xlab = "latitude", ylab = "depth,
m", ylim = c(-160, 0))
image.legend(interp.density$z, size = c(1, 0.1), hor = T)

Strangely enough, this code works fine for a single plot layout.
Locator can successfully place the image.legend bar wherever I
choose.

Where does the inconsistency lie between successful single vs
multiple plot graphs? Any insight would be greatly appreciated. I
have tried specifying legend coordinates (x, y for top left corner)
in the image.legend formula, but same error messages occur.

Many thanks,
Laura

Laura Richards
Biological oceanography, Fisheries Division
National Institute of Water and Atmospheric Research
P.O. Box 14-901, Kilbirnie, Wellington, New Zealand
Tel. +64-4-386-0300/Fax. +64-4-386-0574
**************************************************
"A journey of a thousand miles begins with a single step"
-Lao Tsu
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news