[R] Legend that is big?

Kevin Burton rkevinburton at charter.net
Sun Jan 22 14:34:28 CET 2012


Thanks for the tip. I will try it out. I am more after a legend of colors than readable labels. In fact I would prefer getting rid of the text labels altogether.

On Jan 22, 2012, at 12:46 AM, Jim Lemon <jim at bitwrit.com.au> wrote:

> On 01/22/2012 06:56 AM, Kevin Burton wrote:
>> Of course by entering 'blah' you just get a legend of one value. I guess I would like to remove the text altogether and put the colored boxes (or circles) right next to each other. This would form sort of a gradient. So say I needed a legend for 100 colored values on the plot. The colors are generated by:
>> colors<- rainbow(100)
>> How would I make such a legend?
> 
> Hi Kevin,
> It sounds like you want something like color.legend (plotrix) that draws a rectangle with as many colors as you like. However 100 colors would probably require a legend as big as one side of the plot, and you certainly couldn't get 100 readable labels on it. More like 10.
> 
> Jim
> 



More information about the R-help mailing list