Skip to content

Plotrix: Add text below the color- legend.

5 messages · Alaios, Jim Lemon

#
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
1 day later