MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_RRuleLocator

Function test_RRuleLocator

lib/matplotlib/tests/test_dates.py:230–250  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

228
229@image_comparison(['RRuleLocator_bounds.png'], style='mpl20')
230def 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
253def test_RRuleLocator_dayrange():

Callers

nothing calls this directly

Calls 8

figureMethod · 0.80
set_autoscale_onMethod · 0.80
autofmt_xdateMethod · 0.80
registerMethod · 0.45
plotMethod · 0.45
set_major_locatorMethod · 0.45
set_major_formatterMethod · 0.45
autoscale_viewMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…