@@ -301,6 +301,7 @@ def do_3d_projection(self, renderer=None):
301
301
"""
302
302
Project the points according to renderer matrix.
303
303
"""
304
+ _update_scalarmappable (self )
304
305
xyslist = [proj3d .proj_trans_points (points , self .axes .M )
305
306
for points in self ._segments3d ]
306
307
segments_2d = [np .column_stack ([xs , ys ]) for xs , ys , zs in xyslist ]
@@ -486,6 +487,7 @@ def set_3d_properties(self, zs, zdir):
486
487
487
488
@cbook ._delete_parameter ('3.4' , 'renderer' )
488
489
def do_3d_projection (self , renderer = None ):
490
+ _update_scalarmappable (self )
489
491
xs , ys , zs = self ._offsets3d
490
492
vxs , vys , vzs , vis = proj3d .proj_transform_clip (xs , ys , zs ,
491
493
self .axes .M )
@@ -592,7 +594,7 @@ def set_linewidth(self, lw):
592
594
593
595
@cbook ._delete_parameter ('3.4' , 'renderer' )
594
596
def do_3d_projection (self , renderer = None ):
595
- self . update_scalarmappable ( )
597
+ _update_scalarmappable ( self )
596
598
xs , ys , zs = self ._offsets3d
597
599
vxs , vys , vzs , vis = proj3d .proj_transform_clip (xs , ys , zs ,
598
600
self .axes .M )
@@ -635,15 +637,15 @@ def do_3d_projection(self, renderer=None):
635
637
636
638
return np .min (vzs ) if vzs .size else np .nan
637
639
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 . _facecolor3d = self . _facecolors
644
- elif self . _is_stroked :
645
- self . _edgecolor3d = self . _edgecolors
646
- return ret
640
+
641
+ def _update_scalarmappable ( sm ):
642
+ copy_state = sm . _update_dict [ 'array' ]
643
+ ret = sm . update_scalarmappable ()
644
+ if copy_state :
645
+ if sm . _is_filled :
646
+ sm . _facecolor3d = sm . _facecolors
647
+ elif sm . _is_stroked :
648
+ sm . _edgecolor3d = sm . _edgecolors
647
649
648
650
649
651
def patch_collection_2d_to_3d (col , zs = 0 , zdir = 'z' , depthshade = True ):
@@ -783,10 +785,7 @@ def do_3d_projection(self, renderer=None):
783
785
"""
784
786
Perform the 3D projection for this object.
785
787
"""
786
- # FIXME: This may no longer be needed?
787
- if self ._A is not None :
788
- self .update_scalarmappable ()
789
- self ._facecolors3d = self ._facecolors
788
+ _update_scalarmappable (self )
790
789
791
790
txs , tys , tzs = proj3d ._proj_transform_vec (self ._vec , self .axes .M )
792
791
xyzlist = [(txs [sl ], tys [sl ], tzs [sl ]) for sl in self ._segslices ]
0 commit comments