[R] image() colors

Prof Brian Ripley ripley at stats.ox.ac.uk
Tue Aug 7 17:14:25 CEST 2001


On Tue, 7 Aug 2001, Elena MOLTCHANOVA wrote:

> Hi, everybody!
>
> I am currently dealing with spatial estimation and thus writing some
> smoothing algorithms. My question concerns the graphical output. I would
> like my function to produce a picture of input data (X) and of estimation
> results(Y). Both, X and Y are categorical variables which can take values
> 1,2,...,Cl. So, basically I write

(You have X = 0 in the example.)

> foo<-function(){
> ....
>
> image(X,...,col=terrain.colors(Cl))
> image(Y,...,col=terrain.colors(Cl))
> }
>
> However, as a result of smoothing, some classes may disappear completely.
> For example:
>
> 	  X		  Y
> 	1 1 1		1 1 1
> 	1 0 1		1 1 1
> 	1 1 1		1 1 1
>
> In output then graph for X would have green for 0 and yellow for 1, whereas
> the graph for Y would be all green. Thus the two pictures cannot be
> compared. Is there any way around this problem?

Set zlim = c(0.5, Cl+0.5) for values 1,2,...,Cl.

>
> Thank you in advance for any help.
>
> Best regards,
>
> Elena MOLTCHANOVA
> IIASA
> International Institute for Applied Systems Analysis
> A-2361 Laxenburg, Austria
> E-Mail: moltchan at iiasa.ac.at
> Phone : +43 2236 807-0
> Fax   : +43 2236 71313
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

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