Skip to content

Commit fc6daff

Browse files
vecuencaQuLogic
andcommitted
Add stem orientation test and associated baseline images
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 parent a1696ca commit fc6daff

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3279,6 +3279,19 @@ def test_stem_dates():
32793279
ax.stem(xs, ys, "*-")
32803280

32813281

3282+
@pytest.mark.parametrize("use_line_collection", [True, False],
3283+
ids=['w/ line collection', 'w/o line collection'])
3284+
@image_comparison(['stem_orientation.png'], style='mpl20', remove_text=True)
3285+
def test_stem_orientation(use_line_collection):
3286+
x = np.linspace(0.1, 2*np.pi, 50)
3287+
args = (x, np.cos(x))
3288+
kwargs = dict(linefmt='C2-.', markerfmt='kx', basefmt='C1-.',
3289+
use_line_collection=use_line_collection)
3290+
3291+
fig, ax = plt.subplots()
3292+
ax.stem(*args, **kwargs, orientation='vertical')
3293+
3294+
32823295
@image_comparison(['hist_stacked_stepfilled_alpha'])
32833296
def test_hist_stacked_stepfilled_alpha():
32843297
# make some data

0 commit comments

Comments
 (0)