[R] legend in image()

Roger Peng rpeng at stat.ucla.edu
Tue Sep 17 18:20:45 CEST 2002


Check out `image.plot' in the `fields' package.  Also, `filled.contour'
may do what you want (and seems to produce nicer pictures).

-roger
_______________________________
UCLA Department of Statistics
rpeng at stat.ucla.edu
http://www.stat.ucla.edu/~rpeng

On Tue, 17 Sep 2002, Sam McClatchie wrote:

> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> 

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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