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

Function test_change_interval_multiples

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

Source from the content-addressed store, hash-verified

1282
1283
1284def test_change_interval_multiples():
1285 plt.rcParams['date.interval_multiples'] = False
1286 dates = np.arange('2020-01-10', '2020-05-01', dtype='datetime64[D]')
1287 fig, ax = plt.subplots()
1288
1289 ax.plot(dates, np.arange(len(dates)))
1290 fig.canvas.draw()
1291 assert ax.get_xticklabels()[0].get_text() == 'Jan 10 2020'
1292 assert ax.get_xticklabels()[1].get_text() == 'Jan 24 2020'
1293
1294 plt.rcParams['date.interval_multiples'] = 'True'
1295 fig, ax = plt.subplots()
1296
1297 ax.plot(dates, np.arange(len(dates)))
1298 fig.canvas.draw()
1299 assert ax.get_xticklabels()[0].get_text() == 'Jan 15 2020'
1300 assert ax.get_xticklabels()[1].get_text() == 'Feb 01 2020'
1301
1302
1303def test_DateLocator():

Callers

nothing calls this directly

Calls 4

subplotsMethod · 0.45
plotMethod · 0.45
drawMethod · 0.45
get_textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…