Skip to content
Back to formatted view

Raw Message

Message-ID: <499BF670.70803@stats.uwo.ca>
Date: 2009-02-18T11:52:16Z
From: Duncan Murdoch
Subject: distance betwenn axis and axis annotation
In-Reply-To: <s99bf154.074@ffdata.setur.fo>

Luis Ridao Cruz wrote:
> R-help,
>
> How can I specify the distance between the axis and axis annotation?
>
>
>   
I don't think you can do this directly, but you can do it using mtext.  
For example:

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)

Duncan Murdoch