()
| 228 | |
| 229 | @image_comparison(['RRuleLocator_bounds.png'], style='mpl20') |
| 230 | def test_RRuleLocator(): |
| 231 | import matplotlib.testing.jpl_units as units |
| 232 | units.register() |
| 233 | # This will cause the RRuleLocator to go out of bounds when it tries |
| 234 | # to add padding to the limits, so we make sure it caps at the correct |
| 235 | # boundary values. |
| 236 | t0 = datetime.datetime(1000, 1, 1) |
| 237 | tf = datetime.datetime(6000, 1, 1) |
| 238 | |
| 239 | fig = plt.figure() |
| 240 | ax = plt.subplot() |
| 241 | ax.set_autoscale_on(True) |
| 242 | ax.plot([t0, tf], [0.0, 1.0], marker='o') |
| 243 | |
| 244 | rrule = mdates.rrulewrapper(dateutil.rrule.YEARLY, interval=500) |
| 245 | locator = mdates.RRuleLocator(rrule) |
| 246 | ax.xaxis.set_major_locator(locator) |
| 247 | ax.xaxis.set_major_formatter(mdates.AutoDateFormatter(locator)) |
| 248 | |
| 249 | ax.autoscale_view() |
| 250 | fig.autofmt_xdate() |
| 251 | |
| 252 | |
| 253 | def test_RRuleLocator_dayrange(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…