[R] add a color band

Jim Lemon jim at bitwrit.com.au
Fri Oct 25 11:48:25 CEST 2013


On 10/25/2013 08:38 PM, Alaios wrote:
> Hi all,
> I would like to ask your help to add a color band (Ι am not sure regarding the right term, this color band at the right of the plot "describing" values with their corresponding color.
>
> For now I have only this code
>
>
>
> test<-matrix(data=runif(10000),nrow=100)
> plot(test,axes="FALSE")
>
> axis(1,at=c(0,1),labels=c("a","b")) #
>
> but  I would like to add at the right  side the color legend.
>
> How can I do that in R?
>
> I would like to thank you in advance for your help
>
Hi Alex,
If all else fails, look at color.legend (plotrix).

Jim



More information about the R-help mailing list