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

Skip to content

Commit 83da06e

Browse files
committed
Add histogram density image test
1 parent d79d6bb commit 83da06e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,14 @@ def test_hist_step_filled():
14641464
assert all([p.get_facecolor() == p.get_edgecolor() for p in patches])
14651465

14661466

1467+
@image_comparison(baseline_images=['hist_density'], extensions=['png'])
1468+
def test_hist_density():
1469+
np.random.seed(0)
1470+
data = np.random.standard_normal(2000)
1471+
fig, ax = plt.subplots()
1472+
ax.hist(data, density=True)
1473+
1474+
14671475
@image_comparison(baseline_images=['hist_step_log_bottom'],
14681476
remove_text=True, extensions=['png'])
14691477
def test_hist_step_log_bottom():

0 commit comments

Comments
 (0)