test that tickers are correct for datetimes
()
| 2190 | |
| 2191 | |
| 2192 | def 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") |
nothing calls this directly
no test coverage detected
searching dependent graphs…