Skip to content

Wishlist: more flexible handling of tick labels in axis.Date (PR#7914)

2 messages · Duncan Murdoch

#
I think allowing the user to change the labels is a good idea, but have 
some nitpicking about the details.

- Could you grab a copy of the current axis.Date source from

https://svn.r-project.org/R/trunk/src/library/graphics/R/datetime.R

and edit that, rather than what you see in R?  There are some comments 
in the source that shouldn't be lost.  This will also mean that it's 
easier to detect what changes you've made.

- I'd prefer the interpretation of the labels argument to be very 
similar to what axis() does, i.e. NULL should not be treated specially.
(Actually, I think axis() treats labels=NULL as TRUE, but that's 
undocumented and might be an accident.)

- axis.POSIXct() should be modified in a corresponding way.

- Your test

  if (missing(labels) || labels == TRUE)

will generate warnings if a vector of labels is passed in.  A better 
test is "identical(labels, TRUE)".

- If you set the default value for labels to TRUE, then you don't need 
the "missing(labels)" part of the test.

- Could you also edit

https://svn.r-project.org/R/trunk/src/library/graphics/man/axis.POSIXct.Rd

to reflect your changes?

If you want help with this feel free to contact me off the list; when 
you're done, you can send me the files and I'll review and commit the 
changes.

Duncan Murdoch
gavin.simpson@ucl.ac.uk wrote:
#
murdoch@stats.uwo.ca wrote:
...
Gavin was very fast with this, and his changes are now committed to 
R-devel (which will become version 2.2.0).  Thanks!

Duncan Murdoch