From williamcmay at live.com  Fri Aug 19 00:06:36 2016
From: williamcmay at live.com (William May)
Date: Thu, 18 Aug 2016 22:06:36 +0000
Subject: [Rd] axis.POSIXct and axis.Date fail for reversed axes
Message-ID: <BY2PR13MB0823EB805DDF97D6EB8F7AE4CE150@BY2PR13MB0823.namprd13.prod.outlook.com>

When plotting a reversed time axis with the base graphics system, R 
fails to label the axes.

Example:

times <- c(Sys.time() - 100, Sys.time())
plot(times, 1:2, xlim = times) # correctly labels the x-axis
plot(times, 1:2, xlim = rev(times)) # fails to label the x-axis
axis.POSIXct(1, times) # still fails to add labels

dates <- c(Sys.Date() - 10, Sys.Date())
plot(dates, 1:2, xlim = dates) # correctly labels the x-axis
plot(dates, 1:2, xlim = rev(dates)) # fails to label the x-axis
axis.Date(1, dates) # still fails to add labels

This is clearly due to the variable keep in both axis functions.

keep <- z >= range[1L] & z <= range[2L]

But if the axis is reversed that should be:

keep <- z <= range[1L] & z >= range[2L]



[Rd] axis.POSIXct and axis.Date fail for reversed axes
William May