[R] Repeating grey scale in graph?

Peter Dalgaard p.dalgaard at biostat.ku.dk
Wed Feb 16 15:35:37 CET 2005


Achim Zeileis <Achim.Zeileis at wu-wien.ac.at> writes:

> > In fact, it is still not clear to me why it recycles the ramp even 
> > though it has a surplus of colours (grey levels)! Why not just ignore 
> > the surplus colours?
> 
> It does! 
> cols is a vector of length 42 and only the first 30 are used. Try to
> use your persp call below with col = cols and col = cols[1:30].
> Z

Just to rub it in, consider

> M
     [,1] [,2] [,3] [,4] [,5]
[1,]    2    3    4    5    6
[2,]    3    4    5    6    7
[3,]    4    5    6    7    8
[4,]    5    6    7    8    9
[5,]    6    7    8    9   10
> M2 <- matrix(M[1:16],4,4)
> M2
     [,1] [,2] [,3] [,4]
[1,]    2    6    6    6
[2,]    3    3    7    7
[3,]    4    4    4    8
[4,]    5    5    5    5


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list