Re: [R] Plotting Time against Date for time series data? (2)

About this list Date view Thread view Subject view Author view Attachment view

From: Prof Brian Ripley (ripley@stats.ox.ac.uk)
Date: Tue 18 May 2004 - 05:30:13 EST


Message-id: <Pine.LNX.4.44.0405172027270.8577-100000@gannet.stats>

On Mon, 17 May 2004, Sander Oom wrote:

> Almost but not quite:
>
> Someone told me R would produce such high quality graphics, I would never
> need a separate graphics package again. This does however mean that I need
> to be able to draw the graph exactly the way I want it to look!
>
> I have searched the web and help files extensively, but there are few
> references on plotting time on an axis.

You don't have `time', you have a set of numbers in 0-24. I did suggest
you treat them as such.

> The function presented here
> (http://tolstoy.newcastle.edu.au/R/help/00a/1031.html) could be useful, but
> I'm not sure how to implement it in my example. Anyway there should be a
> simpler way.
>
> The following code uses the example again. It does have hours on the
> x-axis, but the tic marks are printed as: 0, 5, 10, 15, 20. Not a very
> intuitive frequency of tic marks. How do I get R to plot tic marks at: 0,
> 4, 8, 12, 16, 20, 24 or 0, 2, 4..., 24? I want the tic marks to be fixed,

Use axis(), of course. That is in all the basic info on R, as well as all
good books on S/R.

> i.e. they should still go from 0-24 even when the range of the data is
> smaller.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:11 EST