[R] Colour Legend text, in a print color2D.matplot

Jim Lemon jim at bitwrit.com.au
Sun Nov 10 23:59:41 CET 2013

On 11/11/2013 04:57 AM, Alaios wrote:
> Hi all,
> I am plotting very nice looking mattrices with  plotrin...
> so far so good, I would like though to ask you if it would be possible to add at the bottom of the color.legend (this lovely color bar that maps colors to numbers).
> Would that be possible to do that?
Hi Alex,
It is not too difficult:

# first allow printing outside the plot
# get the x component of the label
# from the values passed to color.legend
# see the help page
# get the y coordinate from the y value
# display the label
# restore the clipping


More information about the R-help mailing list