[R] Controlling plot axis for dates

Prof Brian Ripley ripley at stats.ox.ac.uk
Thu Feb 27 18:26:41 CET 2014


On 27/02/2014 17:09, David Parkhurst wrote:
> I’d like to control the number of tick marks on the “x” axis of a plot,
> when the variable there is dates.  I thought to use the xaxp parameter,
> but the documentation for par says “It [i.e., xaxp] is only relevant to
> default numeric axis systems, and not for example to dates.”  My
> question, then, is how to control the number of ticks on an axis that
> represents dates?

See ?Axis and ?axis.Date .

> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

Please do.  It is not clear which plot method it was that produced 
dates, although it is a fair guess that it called Axis().

-- 
Brian D. Ripley,                  ripley at 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




More information about the R-help mailing list