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). 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 -- Ernesto Jardim <ernesto at ipimar.pt> Marine Biologist IPIMAR, Lisboa, Portugal SuSE Linux 8.1;R 1.7.0;LyX 1.3.2;Gnome 2.2.2;OO1.1Beta
Deepayan Sarkar
2003-Jun-05 17:26 UTC
[R] scales in xyplot doesn't seem to work for x axis
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