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

Skip to content

Commit cd42a3f

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

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/matplotlib/tests/test_category.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,5 +297,8 @@ 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+
assert n.shape == (10,)
304+
np.testing.assert_allclose(n, [2., 0., 0., 1., 0., 0., 1., 0., 0., 1.])

0 commit comments

Comments
 (0)