On Sat, Jun 16, 2012 at 1:41 PM, Stephen Eglen
<s.j.eg...@damtp.cam.ac.uk> wrote:
> R does a great job with the fine details regarding plots.  e.g in the
> following:
>
> library(lattice)
> y <- -4:4/10
> xyplot(y~1, las=1)
>
> the y axis is labelled with numbers -0.4, -0.2, 0.0, 0.2, 0.4 with the
> numbers aligned on the decimal point.
>
> How do I get the same behaviour in the colorkey of a levelplot?  e.g.
>
> levelplot(matrix(y,3,3))
>
> the numbers in the colorkey seem left-aligned, and because of the minus
> sign, the numbers now do not align on the decimal point.  Likewise when
> the number of digits changes:
>
> levelplot(matrix(4:12,3,3))

Justification is hard-coded, and that's not easy to change. This is
not only for the colorkey; e.g.,

  xyplot(y~1, scales = list(alternating = 3))

will also give you left-aligned axes on the right.

My only suggestion (other than custom labels as suggested by ilai) is

 levelplot(matrix(4:12,3,3), colorkey = list(space = "left"))

-Deepayan

______________________________________________
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.

Reply via email to