[R] adjusting y axis labels in lattice plots?

Deepayan Sarkar deepayan.sarkar at gmail.com
Wed Jan 23 21:58:40 CET 2008

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.


More information about the R-help mailing list