[R] absolute position in plot()

ivo welch ivo_welch at mailblocks.com
Sat Nov 12 04:13:34 CET 2005


dear R wizards:  could you please point me into the right direction?  I
would like to write a general function arrow(x1,y1,x2,y2), which
naturally draws an arrow.

the basics of writing this function are of course easy.  the only
complication is that I would like the arrow not to exactly hit (x2,y2),
but to stop short just a "tiny bit."  alas, because I want my arrow()
function to be general, I would rather not have to tell it the xlim and
ylim plot parameters.  So, I need something more akin to the absolute
positioning by which the argument "pos" works within the text()
function.  In fact, optimally, I would adopt the default distance that
the "pos=x" uses, and have an optional parameter that allows the user to
change this.

could someone please point me to an example of how to do something like
this?

regards,

/iaw




More information about the R-help mailing list