Skip to content
Prev 22769 / 398502 Next

Reset par(xaxp) in plot

"Yang, Richard" <dyang at nrcan.gc.ca> writes:
...
xaxp is a bit tricky since it gets calculated and *set* by routines
like plot. You can, however, plot without axes, set xaxp, and then use
axis():

 plot(1:10,axes=F)
 par(xaxp=c(1,10,99))
 axis(1)
 axis(2)
 box()

(Arguably, plot(1:10,xaxp=c(1,10,99)) could be coerced to work, but it
currently does not.)