Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f8d02b9 + 8b67728 commit ba0ea86Copy full SHA for ba0ea86
3 files changed
lib/mpl_toolkits/mplot3d/art3d.py
@@ -758,7 +758,7 @@ def set_alpha(self, alpha):
758
raise TypeError('alpha must be a float or None')
759
artist.Artist.set_alpha(self, alpha)
760
try:
761
- self._facecolors = mcolors.to_rgba_array(
+ self._facecolors3d = mcolors.to_rgba_array(
762
self._facecolors3d, self._alpha)
763
except (AttributeError, TypeError, IndexError):
764
pass
lib/mpl_toolkits/tests/baseline_images/test_mplot3d/poly3dcollection_alpha.png
50.8 KB
lib/mpl_toolkits/tests/test_mplot3d.py
@@ -454,6 +454,24 @@ def test_poly_collection_2d_to_3d_empty():
454
assert poly.get_paths() == []
455
456
457
+@image_comparison(baseline_images=['poly3dcollection_alpha'],
458
+ remove_text=True, extensions=['png'])
459
+def test_poly3dcollection_alpha():
460
+ fig = plt.figure()
461
+ ax = fig.gca(projection='3d')
462
+
463
+ poly1 = np.array([[0, 0, 1], [0, 1, 1], [0, 0, 0]], float)
464
+ poly2 = np.array([[0, 1, 1], [1, 1, 1], [1, 1, 0]], float)
465
+ c1 = art3d.Poly3DCollection([poly1], linewidths=3, edgecolor='k',
466
+ facecolor=(0.5, 0.5, 1), closed=True)
467
+ c1.set_alpha(0.5)
468
+ c2 = art3d.Poly3DCollection([poly2], linewidths=3, edgecolor='k',
469
+ facecolor=(1, 0.5, 0.5), closed=False)
470
+ c2.set_alpha(0.5)
471
+ ax.add_collection3d(c1)
472
+ ax.add_collection3d(c2)
473
474
475
@image_comparison(baseline_images=['axes3d_labelpad'], extensions=['png'])
476
def test_axes3d_labelpad():
477
from matplotlib import rcParams
0 commit comments