[R] shifting ticks to left or right

Duncan Murdoch murdoch at stats.uwo.ca
Wed Oct 1 18:47:48 CEST 2008

Schreiber, Stefan wrote:
> Hey list,
> Does anybody knows a command to centre the tick mark labels exactly
> between the tick points (right shift)?
> And then to exclude the last tick label on  the right?
> I know one can shift them using the 'hadj' option in par. But I am
> wondering if there is a more convenient command!
> Thanks a lot!!

Plot the axes twice:  once with ticks and no labels, once with labels 
and no ticks, e.g.

plot(1:10, axes=F)
axis(1, labels=F)
axis(1, at = c(1,3,5,7,9), lty=0)

Duncan Murdoch

More information about the R-help mailing list