Skip to content

Commit 6a1a6e9

Browse files
WeatherGodQuLogic
authored andcommitted
FIX: Add get/set color methods for some 3d collections
closes #3370 We need to do an extra step to propagate the color information back to the 3D projections
1 parent a4128a7 commit 6a1a6e9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,16 @@ def __init__(self, *args, zs=0, zdir='z', depthshade=True, **kwargs):
403403
super().__init__(*args, **kwargs)
404404
self.set_3d_properties(zs, zdir)
405405

406+
def set_facecolor(self, c):
407+
# docstring inherited
408+
super().set_facecolor(c)
409+
self._facecolor3d = self.get_facecolor()
410+
411+
def set_edgecolor(self, c):
412+
# docstring inherited
413+
super().set_edgecolor(c)
414+
self._edgecolor3d = self.get_edgecolor()
415+
406416
def set_sort_zpos(self, val):
407417
"""Set the position to use for z-sorting."""
408418
self._sort_zpos = val
@@ -491,6 +501,16 @@ def set_3d_properties(self, zs, zdir):
491501
self._linewidth3d = self.get_linewidth()
492502
self.stale = True
493503

504+
def set_facecolor(self, c):
505+
# docstring inherited
506+
super().set_facecolor(c)
507+
self._facecolor3d = self.get_facecolor()
508+
509+
def set_edgecolor(self, c):
510+
# docstring inherited
511+
super().set_edgecolor(c)
512+
self._edgecolor3d = self.get_edgecolor()
513+
494514
def do_3d_projection(self, renderer):
495515
xs, ys, zs = self._offsets3d
496516
vxs, vys, vzs, vis = proj3d.proj_transform_clip(xs, ys, zs, renderer.M)
@@ -722,10 +742,12 @@ def do_3d_projection(self, renderer):
722742
return np.nan
723743

724744
def set_facecolor(self, colors):
745+
# docstring inherited
725746
super().set_facecolor(colors)
726747
self._facecolors3d = PolyCollection.get_facecolor(self)
727748

728749
def set_edgecolor(self, colors):
750+
# docstring inherited
729751
super().set_edgecolor(colors)
730752
self._edgecolors3d = PolyCollection.get_edgecolor(self)
731753

0 commit comments

Comments
 (0)