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

Skip to content

Commit 4cd55c5

Browse files
committed
Add connection patch image test
Remove text from connection test
1 parent 0aaf239 commit 4cd55c5

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

lib/matplotlib/tests/test_patches.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ def test_multi_color_hatch():
335335

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

341341

@@ -350,3 +350,15 @@ def test_units_rectangle():
350350
ax.add_patch(p)
351351
ax.set_xlim([4*U.km, 7*U.km])
352352
ax.set_ylim([5*U.km, 9*U.km])
353+
354+
355+
@image_comparison(baseline_images=['connection_patch'], extensions=['png'],
356+
style='mpl20', remove_text=True)
357+
def test_connection_patch():
358+
fig, (ax1, ax2) = plt.subplots(1, 2)
359+
360+
con = mpatches.ConnectionPatch(xyA=(0.1, 0.1), xyB=(0.9, 0.9),
361+
coordsA='data', coordsB='data',
362+
axesA=ax2, axesB=ax1,
363+
arrowstyle="->")
364+
ax2.add_artist(con)

0 commit comments

Comments
 (0)