Skip to content
Prev 255491 / 398506 Next

lattice xscale.components: different ticks on top/bottom axis

On Fri, Mar 11, 2011 at 12:28 AM, <Boris.Vasiliev at forces.gc.ca> wrote:
Well, <top|bottom>$ticks$at is used to place the ticks, and $labels$at
is used to place the labels. They should typically be the same, but
you have changed one and not the other. Everything seems to work if
you set $ticks$at to the same values as $labels$at:


    ##  - bottom labels
+   ans$bottom$ticks$at <- seq(0,10,by=2)
    ans$bottom$labels$at <- seq(0,10,by=2)
    ans$bottom$labels$labels <- paste("B",seq(0,10,by=2),sep="-")

    ##  - top labels
+   ans$top$ticks$at <- seq(1,9,by=2)
    ans$top$labels$at <- seq(1,9,by=2)
    ans$top$labels$labels <- paste("T",seq(1,9,by=2),sep="-")
No. Unrecognized arguments are passed to the panel function only, not
to any other function. However, you can always define an inline
function:

oltc <- xyplot(y~x,data=df,
               scales=list(x=list(limits=c(0,10), at = 0:10, alternating=3)),
               xscale.components = function(...)
xscale.components.A(..., user.value=1))

Hope that helps (and sorry for the late reply).

-Deepayan