Skip to content

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

3 messages · Deepayan Sarkar, Ernesto Jardim

#
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
#
On Thursday 05 June 2003 06:41, Ernesto Jardim wrote:
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', '', '')
#
On Thu, 2003-06-05 at 18:26, Deepayan Sarkar wrote:
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