Skip to content
Prev 332947 / 398506 Next

Colour Legend text, in a print color2D.matplot

On 11/11/2013 04:57 AM, Alaios wrote:
Hi Alex,
It is not too difficult:

# first allow printing outside the plot
par(xpd=TRUE)
# get the x component of the label
# from the values passed to color.legend
# see the help page
labelx<-(xl+xr)/2
# get the y coordinate from the y value
labely<-yb-strheight("M")
# display the label
text(labelx,labely,mylabel)
# restore the clipping
par(xpd=FALSE)

Jim