[R] Additions to xyplot (lattice)? - legend, ticks, axis label size, text

deepayan.sarkar at gmail.com deepayan.sarkar at gmail.com
Thu Aug 30 21:47:11 CEST 2007


On 8/30/07, Dave Hewitt <dhewitt at vims.edu> wrote:
> Thank you very much... simple and easy fixes.
>
> Three"final" queries:
>
> (1) I need to make a little more room on the left for the larger axis
> label. I tried 'mex' in the list for ylab but that was ignored.

It's possible, but shouldn't be necessary. Can you provide a
reproducible example which shows why you need this?

> (2) Is it possible to place a tick at each year on the x-axis, but only
> label every other year?

Not in those terms, but you can explicitly specify labels as

scales = list(x = list(at = c(1, 2, 3), labels = c("a", "", "c")))

etc.

> (3) Can the legend pieces be broken into two lines (one for loess and one
> for points)?

Again, not in those terms, but you can fake it using

key = list(text = list(c("loess", "points")),
           lines = list(lwd = 2.5, col = c("gray", "blue"),
                        cex = 1.25, pch = 19,
                         type = c("p", "l")))

-Deepayan



More information about the R-help mailing list