Hello Everyone, I am Naive user of 'R' statistical environment and still i'm in learning mode. I would like to know how to plot 2D data graphically. i.e. how to color code each cell in 2D Matrix depending on it's value --- red equals bigger numbers and blue indicates smaller. For example my 2D matrix is *4* *109.32* *108.06* *104.48* *3* *111.9* *105* *107.56* *2* *115.32* * 113.28* *111.3* *1* *117.8* *116.74* *116.42* *0* *123.06* *122.66* *123.68* ** *0* *1* *2* Please guide me in this regards. Sincerely... Jaydutt D. Bhalshankar [[alternative HTML version deleted]]
image() is fine to plot the cells of a matrix. i think balloonplot() in gplots and mosaicplot() can do it too. i sometimes do it with bubble() in gstat. Jaydutt Bhalshankar a ??crit :>Hello Everyone, > >I am Naive user of 'R' statistical environment and still i'm in learning >mode. > >I would like to know how to plot 2D data graphically. i.e. how to color code >each cell in 2D Matrix depending on it's value --- red equals bigger numbers >and blue indicates smaller. > >For example my 2D matrix is > > *4* *109.32* *108.06* *104.48* *3* *111.9* *105* *107.56* *2* *115.32* * >113.28* *111.3* *1* *117.8* *116.74* *116.42* *0* *123.06* *122.66* *123.68* >** *0* *1* *2* > >Please guide me in this regards. > >Sincerely... >Jaydutt D. Bhalshankar > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > > >
Jaydutt Bhalshankar wrote:> Hello Everyone, > > I am Naive user of 'R' statistical environment and still i'm in learning > mode. > > I would like to know how to plot 2D data graphically. i.e. how to color code > each cell in 2D Matrix depending on it's value --- red equals bigger numbers > and blue indicates smaller. > > For example my 2D matrix is > > *4* *109.32* *108.06* *104.48* *3* *111.9* *105* *107.56* *2* *115.32* * > 113.28* *111.3* *1* *117.8* *116.74* *116.42* *0* *123.06* *122.66* *123.68* > ** *0* *1* *2*Hi Jaydutt, Have a look at the color.scale function in the plotrix package. It might do what you want in terms of generating a color scale corresponding to the numerical values in your matrix. Jim