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

Increase patch test coverage #9519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions 17 lib/matplotlib/tests/test_arrow_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,20 @@ def test_fancyarrow_dash():
color='k')
ax.add_patch(e)
ax.add_patch(e2)


@image_comparison(baseline_images=['arrow_styles'], extensions=['png'],
style='mpl20', remove_text=True)
def test_arrow_styles():
styles = mpatches.ArrowStyle.get_styles()

n = len(styles)
fig, ax = plt.subplots(figsize=(6, 10))
ax.set_xlim(0, 1)
ax.set_ylim(-1, n)

for i, stylename in enumerate(sorted(styles)):
patch = mpatches.FancyArrowPatch((0.1, i), (0.8, i),
arrowstyle=stylename,
mutation_scale=25)
ax.add_patch(patch)
14 changes: 13 additions & 1 deletion 14 lib/matplotlib/tests/test_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def test_multi_color_hatch():

for i in range(5):
with mstyle.context({'hatch.color': 'C{}'.format(i)}):
r = Rectangle((i-.8/2, 5), .8, 1, hatch='//', fc='none')
r = Rectangle((i - .8 / 2, 5), .8, 1, hatch='//', fc='none')
ax.add_patch(r)


Expand All @@ -350,3 +350,15 @@ def test_units_rectangle():
ax.add_patch(p)
ax.set_xlim([4*U.km, 7*U.km])
ax.set_ylim([5*U.km, 9*U.km])


@image_comparison(baseline_images=['connection_patch'], extensions=['png'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the text from this one too?

style='mpl20', remove_text=True)
def test_connection_patch():
fig, (ax1, ax2) = plt.subplots(1, 2)

con = mpatches.ConnectionPatch(xyA=(0.1, 0.1), xyB=(0.9, 0.9),
coordsA='data', coordsB='data',
axesA=ax2, axesB=ax1,
arrowstyle="->")
ax2.add_artist(con)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.