[R] Pointing to a specific place on the x-axis with an arrow

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Wed Oct 6 15:06:46 CEST 2010


On Wed, Oct 6, 2010 at 12:29 PM, Ivan Calandra
<ivan.calandra at uni-hamburg.de> wrote:
>  Hi again,
>
> Just one little question. I don't understand what "clipping" is.
> Probably a problem with English...
> Therefore the par(xpd=NA) is not really clear for me; nor is the clip()
> function. And I don't see any difference between par(xpd=NA) and nothing.
>
> It's not really related to this post, let me know if I should change the
> subject.

Try this:

 > par(xpd=FALSE)
 > plot(1:10)
 > abline(h=4)
 > par(xpd=NA)
 > abline(h=5)

 the first horizontal line, at y=4, should only be visible in the box
of the plot. The second line, at y=5, should go right across the
graphics window. We say the first line is 'clipped' to the box.

 so, to draw some things outside the box you have to set par(xpd=NA)
first. Its not necessary with things like mtext and axis because they
obviously are going to draw outside the box anyway. It's just for
points, lines, symbols, arrows etc.

Barry



More information about the R-help mailing list