[R-sig-eco] labels to a varpart diagram

Jari Oksanen jari.oksanen at oulu.fi
Fri Apr 8 12:00:34 CEST 2011


On 8/04/11 12:46 PM, "Ingolf Kuehn" <ingolf.kuehn at ufz.de> wrote:

> Dear Emili,
> 
> text works:  the origin of the plot is in the centre upper left circle
> (X1 | X2+X3). Hence text(0, 0, "X1") would overwrite the "0.04".
> Similarly: see text(1, 0, "X2"), text(0.5, -.86, "X3")
> 
> This might help you finding the correct coordinates.
> 
Emili,

You can use locator() function to find the coordinates. It is also possible
to have locator() in the text() command. If you have plotted the varpart()
result, you can do

text(locator(), "My Title", cex=1.2)

Then click the graph with the mouse button-1 (left) where you want to have
your title, then do something that makes the locator() exit to show text "My
Title". (This is a good opportunity to panic if you don't know yet how to
exit locator(): you better check the documentation of ?locator before-hand
to see how to behave in your operating system and graphical device. I
clicked cmd-mouse in my one-button MacBook trackpad when the graph was in
the X11 window, but the manual tells you to hit ESC in quartz graphics, and
Windows may have something different.)

I have considered adding circle labelling to vegan after seeing my mate
using these labels, but I haven't done that yet (contributions are welcome
and will be credited in the documentation).

Cheers, Jari Oksanen



More information about the R-sig-ecology mailing list