[R] scales in xyplot doesn't seem to work for x axis

Deepayan Sarkar deepayan at stat.wisc.edu
Thu Jun 5 19:26:21 CEST 2003


On Thursday 05 June 2003 06:41, Ernesto Jardim wrote:
> Hi
>
> I'm doing a xyplot and I wand to reduce the number of tick marks in the
> x axis. My x axis are month and I want to reduce the 12 tick marks to 4.
> I used the scales argument but it doesn't seem to work, althougth it
> works on y axis if I use scales=list(tick.number=4).

By 'month', so you mean a POSIXct object ? lattice is not very good with 
those.

The other possibility is that your mes is a factor (or a character vector, 
which is essentially the same). In that case, tick.number will have no effect 
(it works only for numeric). You could do something like

xlim = c('Jan', '', '', 'Apr', '', '', 'Jul', '', '', 'Oct', '', '')


> xyplot(land~mes|porto+arte,data=hom.land.mpa[hom.land.mpa$arte!="pseine",],
>type="l",scales=list(x=list(tick.number=4)))
>
> Regards
>
> EJ




More information about the R-help mailing list