[R] legend in image()
Sam McClatchie
s.mcclatchie at niwa.co.nz
Tue Sep 17 02:50:04 CEST 2002
System info:
Linux slackware
R Version 1.5.1 (2002-06-17)
ESS 5.1.21
Emacs 21.2.1
-------------------
Colleagues
Is there a way to add a legend to an image plot? I don't see any
reference to legends in the documentation (so I suppose the answer is
no?). Although the documentation says image takes plot() parameters, it
isn't clear to me how the usual use of legend in a plot command would go
for image(). Perhaps you need to specify 'breaks' and then use something
like:
legend(x,y, breaks, c('label1', label2'...))
?
Here is my function call at the moment without a legend:
image(time.h, z, -log10(t5),
xlab='hours', ylab='depth m',
col=rainbow(20),
main = 'Chatham Rise DVM',
yaxt='n', zlim=c(2,6.5), cex=0.5)
Thanks in advance,
Sam
--
Sam McClatchie, Research scientist (fisheries acoustics))))))))))
NIWA (National Institute of Water & Atmospheric Research Ltd)
PO Box 14 901, Kilbirnie, Wellington, New Zealand
s.mcclatchie at niwa.cri.nz
Research home page <http://www.smcc.150m.com/>
/\
>><xX(&>
/// \\\
//// \\\\
/// <%)Xx><<
///// \\\\\\
><(((@>
><(((%> ..>><xX(?>O<?)Xx><<
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list