Re: [R] adjusting y axis labels in lattice plots?

From: Deepayan Sarkar <deepayan.sarkar_at_gmail.com>
Date: Wed, 23 Jan 2008 12:58:40 -0800

On 1/23/08, Thomas Zumbrunn <t.zumbrunn_at_unibas.ch> wrote:
> Are there parameters that would allow adjusting y axis labels in lattice
> plots? E.g in the following simple example
>
> require(lattice)
> xyplot(rnorm(10) ~ 1:10, scales=list(alternating=2))
>
> it would be nice to have the y axis labels adjusted to the right or at the
> decimal point instead of left adjustment.

There's nothing that allows that sort of adjustment. You can, however specify the labels
("-0.5", " 0.5" etc.), either explicitly through scales$labels or programmatically through the yaxis.components function (which would presumably use format() or something similar). Of course, this will only work reliably if you use a fixed width font.

-Deepayan



R-help_at_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. Received on Wed 23 Jan 2008 - 21:00:56 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 23 Jan 2008 - 22:30:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive