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

Skip to content

Commit 03a960d

Browse files
committed
Add test for histogram with empty dataset
1 parent 2786e39 commit 03a960d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,11 @@ def test_hist_stacked_bar():
11621162
ax.hist(d, bins=10, histtype='barstacked', align='mid', color=colors, label=labels)
11631163
ax.legend(loc='upper right', bbox_to_anchor = (1.0, 1.0), ncol=1)
11641164

1165+
def test_hist_emptydata():
1166+
fig = plt.figure()
1167+
ax = fig.add_subplot(111)
1168+
ax.hist([[], range(10), range(10)], histtype="step")
1169+
11651170
@image_comparison(baseline_images=['transparent_markers'], remove_text=True)
11661171
def test_transparent_markers():
11671172
np.random.seed(0)

0 commit comments

Comments
 (0)