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

Function test_bar_datetime_start

lib/matplotlib/tests/test_axes.py:2192–2205  ·  view source on GitHub ↗

test that tickers are correct for datetimes

()

Source from the content-addressed store, hash-verified

2190
2191
2192def test_bar_datetime_start():
2193 """test that tickers are correct for datetimes"""
2194 start = np.array([np.datetime64('2012-01-01'), np.datetime64('2012-02-01'),
2195 np.datetime64('2012-01-15')])
2196 stop = np.array([np.datetime64('2012-02-07'), np.datetime64('2012-02-13'),
2197 np.datetime64('2012-02-12')])
2198
2199 fig, ax = plt.subplots()
2200 ax.bar([0, 1, 3], height=stop-start, bottom=start)
2201 assert isinstance(ax.yaxis.get_major_formatter(), mdates.AutoDateFormatter)
2202
2203 fig, ax = plt.subplots()
2204 ax.barh([0, 1, 3], width=stop-start, left=start)
2205 assert isinstance(ax.xaxis.get_major_formatter(), mdates.AutoDateFormatter)
2206
2207
2208@image_comparison(["grouped_bar.png"], style="mpl20")

Callers

nothing calls this directly

Calls 4

get_major_formatterMethod · 0.80
barhMethod · 0.80
subplotsMethod · 0.45
barMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…