martin.bader at unibas.ch
2008-Nov-20 13:45 UTC
[Rd] Label justification (axis) (PR#13307)
Full_Name: Martin Karl-Friedrich Bader Version: 2.8.0 OS: 10.5.3 Submission from: (NULL) (131.152.1.1) Hi there, when using las=1 on the y-axis the labels keep their centered justification, e.g. if you plot a graph using the axis command: axis(side=2, at=c(0,50, 100, 125), lab=c("0","50","100", " "), las=1), then the 0 and the 50 are centered in relation to the 100! One can work around that problem by inserting blank spaces in front of the lower numbers (e.g.: " 0") but that's not an appropriate solution! Is there a way that can be fixed? Thanks in advance! Martin
Can you please provide a complete reproducible example, including the device used. E.g. quartz() # or X11() plot(1:200, yaxt="n", type="n") axis(side=2, at=c(0,50,100,125), lab=c("0","50","100"," "), las=1) does not work as you describe (R 2.8.0 in R.app, Mac OS 10.5.5). On Thu, 20 Nov 2008, martin.bader at unibas.ch wrote:> Full_Name: Martin Karl-Friedrich Bader > Version: 2.8.0 > OS: 10.5.3Is that Solaris or SuSE or HP-UX or Mac OS? As only Windows and Mac users seem to be in denial about there being any other OS, I suspect we can infer ....> Submission from: (NULL) (131.152.1.1) > > > Hi there, > > when using las=1 on the y-axis the labels keep their centered justification, > e.g. if you plot a graph using the axis command: axis(side=2, at=c(0,50, 100, > 125), lab=c("0","50","100", " "), las=1), then the 0 and the 50 are centered in > relation to the 100! One can work around that problem by inserting blank spaces > in front of the lower numbers (e.g.: " 0") but that's not an appropriate > solution! Is there a way that can be fixed? Thanks in advance! > > Martin > > ______________________________________________ > R-devel at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-devel >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, stats.ox.ac.uk/~ripley University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
If you want to change the orientation of the axis labels you use las. If you want to change the horizontal justification of the axis labels you use hadj. If you want to change the orientation of the axis labels and the horizontal justification of the axis labels then you use las and hadj at the same time. On 20 nov. 08, at 14:45, martin.bader at unibas.ch wrote:> Full_Name: Martin Karl-Friedrich Bader > Version: 2.8.0 > OS: 10.5.3 > Submission from: (NULL) (131.152.1.1) > > > Hi there, > > when using las=1 on the y-axis the labels keep their centered > justification, > e.g. if you plot a graph using the axis command: axis(side=2, > at=c(0,50, 100, > 125), lab=c("0","50","100", " "), las=1), then the 0 and the 50 are > centered in > relation to the 100! One can work around that problem by inserting > blank spaces > in front of the lower numbers (e.g.: " 0") but that's not an > appropriate > solution! Is there a way that can be fixed? Thanks in advance! > > Martin > > ______________________________________________ > R-devel at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-devel