[R] pixmapIndexed color question

Christoph Lehmann christoph.lehmann at gmx.ch
Mon Jul 12 11:25:37 CEST 2004


Hi

I use pixmapIndexed

tmp.vimp <- array(0,c(x.dim,y.dim))
tmp.vimp <- pixmapIndexed(tmp.vimp, col=rainbow)

to plot values of a 2D matrix. I 'fill' the pixmapIndexed like:

     for (x in 1:x.dim) {
         for (y in 1:y.dim) {
                     tmp.vimp at index[x,y] <- my.matrix[x,y]
     }}


how can I define, that the colors are painted e.g. according the rainbow 
palette?

plot(tmp.vimp) paints all 'pixels' in red even though I specified it 
with col=rainbow (see above)

many thanks

cheers

christoph

p.s. is there an easier method for 'painting' the values of a 2d matrix?




More information about the R-help mailing list