[R] color2d.maplot error

Alaios alaios at yahoo.com
Mon Feb 7 17:25:52 CET 2011


Dear all 
I am using color2D.maplot to map some matrixes to plot. everything works fine. It seems that when my matrix contains only the same value color2D.maplot returns the following error:


color2D.matplot(estimatedsr,redrange=c(0,1),greenrange=c(0,.5),bluerange=c(0,.5),xlab="x",ylab="y",main=sprintf('Estimated'),show.legend=TRUE,show.values=TRUE)
Error in rgb(reds, greens, blues) : color intensity 18.5, not in [0,1]
Calls: color2D.matplot -> color.scale -> rgb


if you want to generate the error above try the following:


require('plotrix')
estimatedsr<-matrix(data=18.5,ncol=6,nrow=6)
color2D.matplot(estimatedsr,redrange=c(0,1),greenrange=c(0,.5),bluerange=c(0,.5),xlab="x",ylab="y",main=sprintf('Estimated'),show.legend=TRUE,show.values=TRUE)



More information about the R-help mailing list