hitendra padalia
2011-Jul-28 06:00 UTC
[R] plotting matrix into 2D color plots with rainbow colors
Dear all, Can you pl. help me in plotting a matrix into 2D plot with more color options. I tried to plot with myImagePlot with RGB color ramp but it shows limited variation in color. There is a rainbow plot option also. Can anyone help me. Regards, Hitendra -- Hitendra Padalia, PhD Scientist/Engineer 'SD' Regional Remote Sensing Centre-North, NRSC Indian Space Research Organisation 4-Kalidas Road, IIRS Campus, Dehradun-248001, Uttarakhand, India Tel: 0135-2524329, Mobile: 09411193962 Fax: 0135-2745439 [[alternative HTML version deleted]]
Jim Lemon
2011-Jul-28 09:02 UTC
[R] plotting matrix into 2D color plots with rainbow colors
On 07/28/2011 04:00 PM, hitendra padalia wrote:> Dear all, > > Can you pl. help me in plotting a matrix into 2D plot with more color > options. I tried to plot with myImagePlot with > RGB color ramp but it shows limited variation in color. There is a rainbow > plot option also. Can anyone help me. >Hi Hitendra, You can specify colors from the rainbow function for color2D.matplot in the plotrix package. However, try this: colormat<-matrix(runif(100),nrow=10) color2D.matplot(colormat,c(1,1,0,0,1),c(0,1,1,1,0),c(0,0,0,1,1)) color.legend(0,-1.6,4,-1.1,seq(0,1,by=0.2),color.scale(seq(0,1,by=0.1), c(1,1,0,0,1),c(0,1,1,1,0),c(0,0,0,1,1))) Jim