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

Commitffb6ae5

Browse files
committed
TST: remove (or test) deprecated Axes3D behavior in tests
1 parentf1938e8 commitffb6ae5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

‎lib/matplotlib/tests/test_collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def test_polycollection_close():
391391
[[3.,0.], [3.,1.], [4.,1.], [4.,0.]]]
392392

393393
fig=plt.figure()
394-
ax=fig.add_axes(Axes3D(fig))
394+
ax=fig.add_axes(Axes3D(fig,auto_add_to_figure=False))
395395

396396
colors= ['r','g','b','y','k']
397397
zpos=list(range(5))

‎lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
frommpl_toolkits.mplot3dimportAxes3D,axes3d,proj3d,art3d
77
importmatplotlibasmpl
88
frommatplotlib.backend_basesimportMouseButton
9+
frommatplotlib.cbookimportMatplotlibDeprecationWarning
910
frommatplotlibimportcm
1011
frommatplotlibimportcolorsasmcolors
1112
frommatplotlib.testing.decoratorsimportimage_comparison,check_figures_equal
1213
frommatplotlib.testing.widgetsimportmock_event
1314
frommatplotlib.collectionsimportLineCollection,PolyCollection
1415
frommatplotlib.patchesimportCircle
16+
1517
importmatplotlib.pyplotasplt
1618
importnumpyasnp
1719

@@ -725,7 +727,7 @@ def test_add_collection3d_zs_scalar():
725727
@mpl3d_image_comparison(['axes3d_labelpad.png'],remove_text=False)
726728
deftest_axes3d_labelpad():
727729
fig=plt.figure()
728-
ax=fig.add_axes(Axes3D(fig))
730+
ax=fig.add_axes(Axes3D(fig,auto_add_to_figure=False))
729731
# labelpad respects rcParams
730732
assertax.xaxis.labelpad==mpl.rcParams['axes.labelpad']
731733
# labelpad can be set in set_label
@@ -1148,7 +1150,8 @@ def test_inverted_cla():
11481150

11491151
deftest_ax3d_tickcolour():
11501152
fig=plt.figure()
1151-
ax=Axes3D(fig)
1153+
withpytest.warns(MatplotlibDeprecationWarning):
1154+
ax=Axes3D(fig)
11521155

11531156
ax.tick_params(axis='x',colors='red')
11541157
ax.tick_params(axis='y',colors='red')

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp