Skip to content
Prev 170885 / 398506 Next

distance betwenn axis and axis annotation

Duncan Murdoch wrote:

            
This is not correct. You can, as Dimitris has already shown. See ?par (sub
mgp). The difficulty arises if you want only one set of axes changed, which
is not what was requested.

## Example using your "example"
par(mfrow = c(1, 2))
x <- 1:10
y <- rnorm(10)

plot(x,y, axes=F)
box()
at <- pretty(x)
min <- par("usr")[1]
max <- par("usr")[2]
at <- at[ at >= min & at <= max]  # pretty extends the range
axis(1, at=at, labels=FALSE)
mtext(at, side=1, at=at, line=3)

plot(x, y, mgp = c(3, 3, 0))

Regards, Mark.
Duncan Murdoch-2 wrote: