[R] color2D.maplot fixed color range

Alaios alaios at yahoo.com
Thu Feb 10 08:28:01 CET 2011


Dear all,
I have 
-one matrix sr ([200,200]) which is the original file
-25 matrixes estimatedsr ([200,200]) which are an estimation of the sr.

As I am plotting these matrixes I want to have ONE common way that the cells are colored. Eg. Values from 10-20--> red color, 20-30-->blue color (or something like that). This is the only way one can easily compare all these matrixes together.

The values of sr are not known in advance as sr is a Gaussian field.
thus the range of the minimum and maximum values of all the matrixes (sr+estimatedsr) are something like that c(0.8*min(sr),1.2*max(sr)). (The estimated sr might estimate values smaller and higher than the original sr).

I am trying since yesterday to do that with colord2D.matplot but so far I failed.
There is a function 
colcolor<-color.scale(sr,xrange=range(sr)) but this just returns colors and not ranges where a color should be applied.
so when I plot my images with:

color2D.matplot(estimatedsr,xlab="x",ylab="y",main=sprintf('Estimated %d',i),show.legend=FALSE,show.values=FALSE,border=NA,cellcolors=colcolor)

all the plots get the same cell color in every cell which too far from correct.

So do you know if it is possible with color2D.maplot or with other plotting technique to plot many diagrammes that use the same coloring scheme (values dynamically predetermined are matched to specific colors).

I would like to thank you in advance for your help

Best REgards
Alex



More information about the R-help mailing list