Skip to content

abline outside of plot region

3 messages · Nick Sabbe, Peter Ehlers, Rolf Turner

#
On 2011-04-29 06:14, Nick Sabbe wrote:
plot(1:4, xaxt='n')
   axis(1, at=2:3, lab=c('a', 'b'),
        col.ticks=3, col.axis=2, lwd=0, lwd.ticks=1)
   par(xpd = TRUE)
   abline(v = 4)

Peter Ehlers
#
On 30/04/11 01:14, Nick Sabbe wrote:
<SNIP>

I think what has happened is not that *you* changed some graphical 
parameter,
but rather that the package Hmisc did.  In a rather strange way.  (I 
*presume*
that you are using the errbar() function out of Hmisc rather than out of the
sfsmisc package --- you didn't say).

For a while I thought that the problem was associated with the 
*installation*
of Hmisc, becomes it seemed to happen only on the first occasion after I
did the install, and on later occasions (quit from R, restart, load Hmisc,
try errbar and abline) the problem did not occur.

But then, about the third time I tried the re-install, the problem never 
happened
at all.  But it ***did*** happen, a couple of times.  So you're not 
imagining it,
you'll be pleased to know.

I think that if it *does* happen to you again, you can fix it by setting

     par(xpd=FALSE)

I checked on par()$xpd a couple of times when the problem occurred,
and got NA, which is consistent with the observed problem.

The whole thing is weird, but.  Gremlins?

     cheers,

         Rolf Turner