Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 40751cb

Browse filesBrowse files
committed
Add test for remaining axis options
1 parent 4fda5ff commit 40751cb
Copy full SHA for 40751cb

File tree

Expand file treeCollapse file tree

2 files changed

+18
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+18
-0
lines changed
Loading

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7280,6 +7280,24 @@ 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+
# Draw a line and a circle fitting within the boundaries of the line
7288+
# The circle should look like a circle for 'scaled' and 'image'
7289+
# High/narrow aspect ratio
7290+
axes[0, i].plot((1, 2), (1, 3.2))
7291+
axes[0, i].axis(option)
7292+
axes[0, i].add_artist(mpatches.Circle((1.5, 1.5), radius=0.5,
7293+
facecolor='none', edgecolor='k'))
7294+
# Low/wide aspect ratio
7295+
axes[1, i].plot((1, 2.25), (1, 1.75))
7296+
axes[1, i].axis(option)
7297+
axes[1, i].add_artist(mpatches.Circle((1.5, 1.25), radius=0.25,
7298+
facecolor='none', edgecolor='k'))
7299+
7300+
72837301
def color_boxes(fig, ax):
72847302
"""
72857303
Helper for the tests below that test the extents of various axes elements

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.