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

Skip to content

Commit bffd42a

Browse files
committed
Add test for remaining axis options
1 parent 4fda5ff commit bffd42a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/matplotlib/tests/test_axes.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7280,6 +7280,20 @@ def test_secondary_repr():
72807280
assert repr(secax) == '<SecondaryAxis: >'
72817281

72827282

7283+
@image_comparison(['axis_options.png'], remove_text=True, style='mpl20')
7284+
def test_axis_options():
7285+
fig, axes = plt.subplots(2, 3)
7286+
for i, option in enumerate(('scaled', 'tight', 'image')):
7287+
axes[0, i].plot((1, 2), (1, 3.2))
7288+
axes[0, i].axis(option)
7289+
axes[0, i].add_artist(mpatches.Circle((1.5, 1.5), radius=0.5,
7290+
facecolor='none', edgecolor='k'))
7291+
axes[1, i].plot((1, 2.25), (1, 1.75))
7292+
axes[1, i].axis(option)
7293+
axes[1, i].add_artist(mpatches.Circle((1.5, 1.25), radius=0.25,
7294+
facecolor='none', edgecolor='k'))
7295+
7296+
72837297
def color_boxes(fig, ax):
72847298
"""
72857299
Helper for the tests below that test the extents of various axes elements

0 commit comments

Comments
 (0)