You could use the mar= argument of the par() function to define a wider plot margin on the right, then change the first and third arguments of color.legend() to make the legend fit in the margin. For example,
par(mar=c(3, 1, 3, 7)) color2D.matplot(test, axes="F", xlab="", ylab="", main="color.scale", extremes=c("#FF0000","#FFFF00"), show.legend=FALSE) axis(1, at=seq(1, ncol(test), length.out=10), labels=seq(201, 300, length.out=10)) color.legend(105, 30, 115, 70, seq(-110, -30, length=11), align="rb", rect.col=color.scale(1:30, 1, c(0,1), 0), gradient="y") Jean On Wed, Oct 30, 2013 at 12:09 PM, Alaios <ala...@yahoo.com> wrote: > Hi, > I have some code that you can simply execute: > > require(plotrix) > > test<-matrix(data=rnorm(10000,-100,5),nrow=100) > color2D.matplot(test,axes="F",xlab="",ylab="",main="color.scale", > extremes=c("#FF0000","#FFFF00"),show.legend=FALSE) > > > axis(1,at=seq(1,ncol(test),length.out=10),labels=seq(201,300,length.out=10)) > color.legend(84,30,125,70,seq(-110,-30,length=11), > align="rb",rect.col=color.scale(1:30,1,c(0,1),0),gradient="y") > > > What I would like to do is to make space at the right for the color band . > The band should have one color from -110 to -30 with scales of 10. > > Can someone help me with that? > > Regards > Alex > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.