matplotlib/matplotlib — pull request #1925 by pelson (2013-04-19 14:20:42+00:00)
Title: Supported datetimes with microseconds, and those with long time series (>160 years).

This pull request updates the AutoDateLocator and AutoDateFormatter classes to handle extreme time series (```<1``` second and ```>160``` years).

The follow code demonstrates the problems:

```

import datetime as dt
import numpy as np
import matplotlib.pyplot as plt

d1 = dt.datetime(1990, 1, 1)

if False:
n = 365 * 200
x = np.array([d1 + dt.timedelta(days=i) for i in range(n)], dtype=object)
else:
n = int(1e4)
x = np.array([d1 + dt.timedelta(microseconds=i * 10) for i in range(n)], dtype=object)

y = np.sin(np.linspace(0, np.pi * 2, n))

plt.figure(figsize=(12, 6))
plt.plot(x, y)

ax = plt.gca()
dt_loc = ax.xaxis.get_major_locator()
plt.show()
```

(try running this before this PR to see the improvement)