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

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

On 1/23/08, Thomas Zumbrunn <> 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 mailing list PLEASE do read the posting guide 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 Please read the posting guide before posting to the list.

list of date sections of archive