[R] Adjusting axis labels on lattice xyplot

Rich Shepard rshepard at appl-ecosys.com
Fri Oct 14 21:03:33 CEST 2016


   I've read chapters 7 and 8 in the Lattice book and do not see how to thin
labels on the x and y axes of an xyplot(), and how to rotate the dates on
the x axis for easier reading (rot did not do the job for me.)

   The data (as raindata.dat) and the existing plot (as precip.pdf) are
attached.

   The ploting command used is:

xyplot(rain$amount ~ rain$date | rain$station, main="Weather Stations",
xlab="Date", ylab="Amount (inches)", pch=16, col=132)

   Please point me to the appropriate place in the book where the prepanel
function to change the axis lable spacing and rotation is discussed. I
expected it to be in chapter 8. Or, if there's another reference I should
read, please point me to that.

   For some reason I've not yet tracked down, there is no longer help
available within the R session (running in emacs with ESS) when I type, for
example, ?xyplot. R returns the message that there's no documentation in the
specified packages and libraries. Obviously something changed since I last
used R.

Rich
-------------- next part --------------
structure(list(station = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L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L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
    27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 
    39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 
    51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 
    1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
    27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 
    39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 
    51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 
    1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
    27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 
    39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 
    51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 
    1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
    27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 
    39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 
    51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L, 
    1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 
    15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 26L, 
    27L, 28L, 29L, 30L, 31L, 32L, 33L, 34L, 35L, 36L, 37L, 38L, 
    39L, 40L, 41L, 42L, 43L, 44L, 45L, 46L, 47L, 48L, 49L, 50L, 
    51L, 52L, 53L, 54L, 55L, 56L, 57L, 58L, 59L, 60L, 61L, 62L
    ), .Label = c("2013-12-01", "2013-12-02", "2013-12-03", "2013-12-04", 
    "2013-12-05", "2013-12-06", "2013-12-07", "2013-12-08", "2013-12-09", 
    "2013-12-10", "2013-12-11", "2013-12-12", "2013-12-13", "2013-12-14", 
    "2013-12-15", "2013-12-16", "2013-12-17", "2013-12-18", "2013-12-19", 
    "2013-12-20", "2013-12-21", "2013-12-22", "2013-12-23", "2013-12-24", 
    "2013-12-25", "2013-12-26", "2013-12-27", "2013-12-28", "2013-12-29", 
    "2013-12-30", "2013-12-31", "2014-01-01", "2014-01-02", "2014-01-03", 
    "2014-01-04", "2014-01-05", "2014-01-06", "2014-01-07", "2014-01-08", 
    "2014-01-09", "2014-01-10", "2014-01-11", "2014-01-12", "2014-01-13", 
    "2014-01-14", "2014-01-15", "2014-01-16", "2014-01-17", "2014-01-18", 
    "2014-01-19", "2014-01-20", "2014-01-21", "2014-01-22", "2014-01-23", 
    "2014-01-24", "2014-01-25", "2014-01-26", "2014-01-27", "2014-01-28", 
    "2014-01-29", "2014-01-30", "2014-01-31"), class = "factor"), 
    amount = structure(c(1L, 1L, 3L, 2L, 2L, 2L, 12L, 18L, 34L, 
    14L, 32L, 39L, 20L, 3L, 3L, 3L, 3L, 3L, 3L, 2L, 2L, 3L, 1L, 
    2L, 2L, 2L, 1L, 9L, 33L, 5L, 1L, 24L, 45L, 6L, 1L, 2L, 3L, 
    3L, 2L, 2L, 1L, 2L, 2L, 10L, 3L, 4L, 3L, 3L, 1L, 11L, 4L, 
    15L, 3L, 1L, 4L,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L, 3L, 
    2L, 1L, 2L, 4L, 2L, 3L, 6L, 4L, 6L, 3L, 1L, 2L, 15L, 25L, 
    41L, 37L, 37L, 46L, 29L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 
    4L, 3L, 1L, 2L, 2L, 2L, 9L, 38L, 12L, 7L), .Label = c("", 
    "0.00", "0.01", "0.02", "0.03", "0.04", "0.05", "0.06", "0.07", 
    "0.08", "0.09", "0.10", "0.11", "0.12", "0.13", "0.15", "0.21", 
    "0.22", "0.23", "0.24", "0.25", "0.27", "0.28", "0.32", "0.34", 
    "0.36", "0.40", "0.42", "0.44", "0.45", "0.46", "0.47", "0.48", 
    "0.49", "0.54", "0.60", "0.61", "0.62", "0.70", "0.71", "0.84", 
    "0.87", "0.90", "0.91", "0.92", "1.00", "1.06", "T"), class = "factor")), .Names = c("station", 
"date", "amount"), class = "data.frame", row.names = c(NA, -341L
))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: precip.pdf
Type: application/pdf
Size: 13071 bytes
Desc: 
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20161014/e501664e/attachment.pdf>


More information about the R-help mailing list