Re: [R] pixmapIndexed color question

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Tue 13 Jul 2004 - 02:06:37 EST

Christoph Lehmann wrote:

> 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@index[x,y] <- my.matrix[x,y]
> }}

I guess you are going to call it like this:

   pixmapIndexed(my.matrix, col=rainbow)

If you change the data after the call to pixmapIndexed(), the color information won't be calculated again. See the function definition itself for details (as well as the help page).

Uwe Ligges

>
> 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?
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue Jul 13 02:13:45 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:54:51 EST