Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitb43ca32

Browse files
committed
Add test
1 parent5bb29e0 commitb43ca32

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

‎lib/matplotlib/tests/test_artist.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
importmatplotlib.pathasmpath
1313
importmatplotlib.transformsasmtrans
1414
importmatplotlib.collectionsasmcollections
15+
importmatplotlibasmpl
1516
frommatplotlib.testing.decoratorsimportimage_comparison,cleanup
1617

1718
fromnose.toolsimport (assert_true,assert_false)
@@ -176,6 +177,26 @@ def test_remove():
176177
assert_true(ax.stale)
177178

178179

180+
@image_comparison(baseline_images=["default_edges"],remove_text=True,
181+
extensions=['png'],style='default')
182+
deftest_default_edges():
183+
withmpl.rc_context({'patch.linewidth':None}):
184+
fig, [[ax1,ax2], [ax3,ax4]]=plt.subplots(2,2)
185+
186+
ax1.plot(np.arange(10),np.arange(10),'x',
187+
np.arange(10)+1,np.arange(10),'o')
188+
ax2.bar(np.arange(10),np.arange(10))
189+
ax3.text(0,0,"BOX",bbox=dict(boxstyle='sawtooth'))
190+
ax3.set_xlim((-1,1))
191+
ax3.set_ylim((-1,1))
192+
pp1=mpatches.PathPatch(
193+
mpath.Path([(0,0), (1,0), (1,1), (0,0)],
194+
[mpath.Path.MOVETO,mpath.Path.CURVE3,
195+
mpath.Path.CURVE3,mpath.Path.CLOSEPOLY]),
196+
fc="none",transform=ax4.transData)
197+
ax4.add_patch(pp1)
198+
199+
179200
if__name__=='__main__':
180201
importnose
181202
nose.runmodule(argv=['-s','--with-doctest'],exit=False)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp