matplotlib/matplotlib — pull request #3648 by elpres (2014-10-15 15:28:36+00:00)
Title: dates.YearLocator doesn't handle inverted axes

All other Locators are derived from RRuleLocator, which has the following check inside its `__call__` routine:

try:
dmin, dmax = self.viewlim_to_dt()
except ValueError:
return []

if dmin > dmax:
dmax, dmin = dmin, dmax

YearLocator just gets values for `dmin` and `dmax` in the same manner as above and goes on using them without checking for ordering and swapping if necessary. This leads to only one tick on inverted axes using YearLocator.