Thank you very much! That's the way to go!
Cheers, Stefan -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2008 10:52 AM To: Schreiber, Stefan Cc: r-help@r-project.org; [EMAIL PROTECTED] Subject: Re: [R] shifting ticks to left or right > 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! A little nasty, but: plot(1:10, axes=FALSE) par(tcl=-0.5) Axis(side=1, at=c(1,5,9), labels=rep("",3)) par(tcl=0) Axis(side=1, at=c(3,7), labels=c("foo", "bar")) Regards, Richie. Mathematical Sciences Unit HSL 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 -----Original Message----- From: Peter Dalgaard [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 01, 2008 10:38 AM To: Schreiber, Stefan Cc: r-help@r-project.org Subject: Re: [R] shifting ticks to left or right 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!! > > Stefan > Hmm, are you solving the right problem there? Sounds like it would be easier to do TWO axes, one with no labels and another with no tickmarks: z<-seq(from=.5,length=10) plot(z,sin(z),xaxt="n", xlim=c(0,10)) axis(1,at=z, labels=letters[1:10], tick=F) axis(1,at=0:10, labels=F) -- O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.