Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e9efb6c

Browse files
committed
TST: test categorical
1 parent 90194ca commit e9efb6c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lib/matplotlib/tests/test_category.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,5 +297,9 @@ def test_overriding_units_in_plot(fig_test, fig_ref):
297297
assert y_units is ax.yaxis.units
298298

299299

300-
def test_category_hist():
301-
300+
def test_hist():
301+
fig, ax = plt.subplots()
302+
n, bins, patches = ax.hist(['a', 'b', 'a', 'c', 'ff'])
303+
print(n, bins)
304+
assert n.shape == (10,)
305+
np.testing.assert_allclose(n, [2., 0., 0., 1., 0., 0., 1., 0., 0., 1.])

0 commit comments

Comments
 (0)