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

Skip to content

Commit 5cbf028

Browse files
committed
Add stem image test
Add legend to stem test
1 parent c280700 commit 5cbf028

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Loading

lib/matplotlib/tests/test_axes.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2836,6 +2836,17 @@ def test_hist_stacked_weighted():
28362836
ax.hist((d1, d2), weights=(w1, w2), histtype="stepfilled", stacked=True)
28372837

28382838

2839+
@image_comparison(baseline_images=['stem'], extensions=['png'], style='mpl20',
2840+
remove_text=True)
2841+
def test_stem():
2842+
x = np.linspace(0.1, 2 * np.pi, 100)
2843+
2844+
fig, ax = plt.subplots()
2845+
ax.stem(x, np.cos(x), linefmt='C0-', markerfmt='k+', basefmt='C1-.',
2846+
label='Stem')
2847+
ax.legend()
2848+
2849+
28392850
def test_stem_args():
28402851
fig = plt.figure()
28412852
ax = fig.add_subplot(1, 1, 1)

0 commit comments

Comments
 (0)