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

Ernesto Jardim ernesto at ipimar.pt
Fri Jun 6 12:38:28 CEST 2003


On Thu, 2003-06-05 at 18:26, Deepayan Sarkar wrote:
> 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

Hi

You're correct my "mes" variable is a factor. But I can transform it to
a numeric variable or use your sugestion.

It would be nice to add this restrition to the lattice documentation.

Regards and thanks

EJ




More information about the R-help mailing list