()
| 272 | |
| 273 | @image_comparison(['DateFormatter_fractionalSeconds.png'], style='mpl20') |
| 274 | def test_DateFormatter(): |
| 275 | import matplotlib.testing.jpl_units as units |
| 276 | units.register() |
| 277 | |
| 278 | # Let's make sure that DateFormatter will allow us to have tick marks |
| 279 | # at intervals of fractional seconds. |
| 280 | |
| 281 | t0 = datetime.datetime(2001, 1, 1, 0, 0, 0) |
| 282 | tf = datetime.datetime(2001, 1, 1, 0, 0, 1) |
| 283 | |
| 284 | fig = plt.figure() |
| 285 | ax = plt.subplot() |
| 286 | ax.set_autoscale_on(True) |
| 287 | ax.plot([t0, tf], [0.0, 1.0], marker='o') |
| 288 | |
| 289 | # rrule = mpldates.rrulewrapper( dateutil.rrule.YEARLY, interval=500 ) |
| 290 | # locator = mpldates.RRuleLocator( rrule ) |
| 291 | # ax.xaxis.set_major_locator( locator ) |
| 292 | # ax.xaxis.set_major_formatter( mpldates.AutoDateFormatter(locator) ) |
| 293 | |
| 294 | ax.autoscale_view() |
| 295 | fig.autofmt_xdate() |
| 296 | |
| 297 | |
| 298 | def test_locator_set_formatter(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…