Skip to content

Commit 98ebe3d

Browse files
committed
Add test for 3d conversion of empty PolyCollection
1 parent d916da2 commit 98ebe3d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/mpl_toolkits/tests/test_mplot3d.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from mpl_toolkits.mplot3d import Axes3D, axes3d, proj3d, art3d
44
from matplotlib import cm
55
from matplotlib.testing.decorators import image_comparison, check_figures_equal
6-
from matplotlib.collections import LineCollection
6+
from matplotlib.collections import LineCollection, PolyCollection
77
from matplotlib.patches import Circle
88
import matplotlib.pyplot as plt
99
import numpy as np
@@ -440,6 +440,13 @@ def test_poly3dcollection_closed():
440440
ax.add_collection3d(c2)
441441

442442

443+
def test_poly_collection_2d_to_3d_empty():
444+
poly = PolyCollection([])
445+
art3d.poly_collection_2d_to_3d(poly)
446+
assert isinstance(poly, art3d.Poly3DCollection)
447+
assert poly.get_paths() == []
448+
449+
443450
@image_comparison(baseline_images=['axes3d_labelpad'], extensions=['png'])
444451
def test_axes3d_labelpad():
445452
from matplotlib import rcParams

0 commit comments

Comments
 (0)