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

Function test_bar_timedelta

lib/matplotlib/tests/test_axes.py:2166–2189  ·  view source on GitHub ↗

Smoketest that bar can handle width and height in delta units.

()

Source from the content-addressed store, hash-verified

2164
2165
2166def test_bar_timedelta():
2167 """Smoketest that bar can handle width and height in delta units."""
2168 fig, ax = plt.subplots()
2169 ax.bar(datetime.datetime(2018, 1, 1), 1.,
2170 width=datetime.timedelta(hours=3))
2171 ax.bar(datetime.datetime(2018, 1, 1), 1.,
2172 xerr=datetime.timedelta(hours=2),
2173 width=datetime.timedelta(hours=3))
2174 fig, ax = plt.subplots()
2175 ax.barh(datetime.datetime(2018, 1, 1), 1,
2176 height=datetime.timedelta(hours=3))
2177 ax.barh(datetime.datetime(2018, 1, 1), 1,
2178 height=datetime.timedelta(hours=3),
2179 yerr=datetime.timedelta(hours=2))
2180 fig, ax = plt.subplots()
2181 ax.barh([datetime.datetime(2018, 1, 1), datetime.datetime(2018, 1, 1)],
2182 np.array([1, 1.5]),
2183 height=datetime.timedelta(hours=3))
2184 ax.barh([datetime.datetime(2018, 1, 1), datetime.datetime(2018, 1, 1)],
2185 np.array([1, 1.5]),
2186 height=[datetime.timedelta(hours=t) for t in [1, 2]])
2187 ax.broken_barh([(datetime.datetime(2018, 1, 1),
2188 datetime.timedelta(hours=1))],
2189 (10, 20))
2190
2191
2192def test_bar_datetime_start():

Callers

nothing calls this directly

Calls 4

barhMethod · 0.80
broken_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…