Skip to content

Commit 1036193

Browse files
committed
FIX: make sure scalarmappable updates are handleded correctly in 3D
1 parent 10b065f commit 1036193

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lib/mpl_toolkits/mplot3d/art3d.py

+11
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ def set_linewidth(self, lw):
592592

593593
@cbook._delete_parameter('3.4', 'renderer')
594594
def do_3d_projection(self, renderer=None):
595+
self.update_scalarmappable()
595596
xs, ys, zs = self._offsets3d
596597
vxs, vys, vzs, vis = proj3d.proj_transform_clip(xs, ys, zs,
597598
self.axes.M)
@@ -634,6 +635,16 @@ def do_3d_projection(self, renderer=None):
634635

635636
return np.min(vzs) if vzs.size else np.nan
636637

638+
def update_scalarmappable(self):
639+
copy_state = self._update_dict['array']
640+
ret = super().update_scalarmappable()
641+
if copy_state:
642+
if self._is_filled:
643+
self._facecolors3d = self._facecolors
644+
elif self._is_stroked:
645+
self._edgecolors3d = self._edgecolors
646+
return ret
647+
637648

638649
def patch_collection_2d_to_3d(col, zs=0, zdir='z', depthshade=True):
639650
"""

0 commit comments

Comments
 (0)