[R] Customize axis labels in xyplot

Deepayan Sarkar deepayan.sarkar at gmail.com
Mon Jun 22 04:52:43 CEST 2009


On Sat, Jun 20, 2009 at 9:13 AM, nmset<nmset at netcourrier.com> wrote:
>
> Hello,
>
> I'm plotting an xyplot where a continuous var recorded every min is plotted
> on y, and time expressed as HH:MM:SS on x, as follows :
>
> xaxis=list(tick.number=12,rot=90)
> lst=list(x=xaxis)
> xyplot(upt$LOAD_1 ~ upt$TIME, data=upt, type=c('g','p', 'r'), scales=lst)
>
> On the x-axis, every time label is drawn and the label quickly become
> unreadable as they overlap on each other.
>
> I wished to limit the number of label with 'tick.number=12' but it does not
> work as the x values are not treated as a numerical sequence.
>
> How can I limit the number of ticks and labels for a time series expressed
> as HH:MM:SS ?
>
> One way might be to convert to mins from an origin, the result would be less
> expressive though.

A reproducible example would help. Have you tried using a date-time class?

-Deepayan




More information about the R-help mailing list