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

Skip to content

Commit 9a508c8

Browse files
committed
FIX: get tests working
1 parent 10f78fa commit 9a508c8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/matplotlib/tests/test_collections.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,7 @@ def test_EllipseCollection():
382382

383383
@image_comparison(['polycollection_close.png'], remove_text=True)
384384
def test_polycollection_close():
385+
from mpl_toolkits.mplot3d import Axes3D
385386

386387
vertsQuad = [
387388
[[0., 0.], [0., 1.], [1., 1.], [1., 0.]],
@@ -390,7 +391,7 @@ def test_polycollection_close():
390391
[[3., 0.], [3., 1.], [4., 1.], [4., 0.]]]
391392

392393
fig = plt.figure()
393-
ax = fig.add_subplot(projection='3d')
394+
ax = fig.add_axes(Axes3D(fig, add=False))
394395

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

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import pytest
55

6-
from mpl_toolkits.mplot3d import axes3d, proj3d, art3d
6+
from mpl_toolkits.mplot3d import Axes3D, axes3d, proj3d, art3d
77
import matplotlib as mpl
88
from matplotlib.backend_bases import MouseButton
99
from matplotlib import cm
@@ -702,7 +702,8 @@ def test_add_collection3d_zs_scalar():
702702
@mpl3d_image_comparison(['axes3d_labelpad.png'], remove_text=False)
703703
def test_axes3d_labelpad():
704704
fig = plt.figure()
705-
ax = fig.add_subplot(projection='3d')
705+
ax = Axes3D(fig, add=False)
706+
fig.add_axes(ax)
706707
# labelpad respects rcParams
707708
assert ax.xaxis.labelpad == mpl.rcParams['axes.labelpad']
708709
# labelpad can be set in set_label

0 commit comments

Comments
 (0)