Skip to content

Commit 2f568c7

Browse files
committed
add test for closed parameter for Poly3DCollection
1 parent 1deff71 commit 2f568c7

File tree

4 files changed

+328
-1
lines changed

4 files changed

+328
-1
lines changed
Binary file not shown.
Lines changed: 311 additions & 0 deletions
Loading

lib/mpl_toolkits/tests/test_mplot3d.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from mpl_toolkits.mplot3d import Axes3D, axes3d, proj3d
3+
from mpl_toolkits.mplot3d import Axes3D, axes3d, proj3d, art3d
44
from matplotlib import cm
55
from matplotlib.testing.decorators import image_comparison
66
from matplotlib.collections import LineCollection
@@ -312,6 +312,22 @@ def test_quiver3d_pivot_tail():
312312
ax.quiver(x, y, z, u, v, w, length=0.1, pivot='tail', normalize=True)
313313

314314

315+
@image_comparison(baseline_images=['poly3dcollection_closed'],
316+
remove_text=True)
317+
def test_poly3dcollection_closed():
318+
fig = plt.figure()
319+
ax = fig.gca(projection='3d')
320+
321+
poly1 = np.array([[0, 0, 1], [0, 1, 1], [0, 0, 0]], np.float)
322+
poly2 = np.array([[0, 1, 1], [1, 1, 1], [1, 1, 0]], np.float)
323+
c1 = art3d.Poly3DCollection([poly1], linewidths=3, edgecolor='k',
324+
facecolor=(0.5, 0.5, 1, 0.5), closed=True)
325+
c2 = art3d.Poly3DCollection([poly2], linewidths=3, edgecolor='k',
326+
facecolor=(1, 0.5, 0.5, 0.5), closed=False)
327+
ax.add_collection3d(c1)
328+
ax.add_collection3d(c2)
329+
330+
315331
@image_comparison(baseline_images=['axes3d_labelpad'], extensions=['png'])
316332
def test_axes3d_labelpad():
317333
from matplotlib import rcParams

0 commit comments

Comments
 (0)