[R] Second axis on bottom of graph

S Ellison S.Ellison at LGCGroup.com
Fri May 16 13:40:52 CEST 2014


> The first ten lines of code work OK temporariy.
> The final line is for a second more-usual axis.
> But if I say line=4 to prevent its overwriting the first axis, it goes off the graph
> page.
> How do I solve that prob;em?

Change the plot margins before plotting using par(mar)

Example:

windows() #or X11()
par(mar=c(6.5, 4,4,2)+0.1)
plot(1:10, xlab="")
axis(1, line=4)

Also consider using par(mgp) to get the axis labels a bit closer to the axis, or using mtext() to place x axis labels.

S Ellison



*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list