Re: [R] controlling location of labels in axis()

2008-06-12 Thread Andrew Yee
Thanks for the reply. I think I've figured it out, you can set this with the mgp parameter. So I'd use the following statement instead: axis(1, at=foo$plot.x, labels=foo$plot.x, mgp=c(3,0.5,1)) #this brings the axis labels closer to the axis line Andrew On Thu, Jun 12, 2008 at 9:53 AM, Toby Ma

Re: [R] controlling location of labels in axis()

2008-06-12 Thread Toby Marthews
Hi Andrew, Perhaps this example would help. You can add in spaces to the mtext text to move the text sideways. par(mai=c(0.5,0.5,0.5,0.5),oma=c(2,2,2,2)) #mai units are INCHES, oma units are LINES plot(runif(50),xlab="xlab",ylab="ylab",bty="l") #n.b. these labels don't appear mtext("First in

[R] controlling location of labels in axis()

2008-06-12 Thread Andrew Yee
Here's a naive question about axis() How do you control the location of the labels with the axis() command? In the following example: foo <- data.frame(plot.x=seq(1:3), plot.y=seq(4:6)) plot(foo$plot.x, foo$plot.y, type='n', axes=FALSE) points(foo$plot.x, foo$plot.y) axis(1, at=foo$plot.x, label