@@ -405,62 +405,41 @@ def draw(self, renderer):
405405
406406 # add the projection matrix to the renderer
407407 self .M = self .get_proj ()
408- props3d = {
409- # To raise a deprecation, we need to wrap the attribute in a
410- # function, but binding that to an instance does not work, as you
411- # would end up with an instance-specific method. Properties are
412- # class-level attributes which *are* functions, so we do that
413- # instead.
414- # This dictionary comprehension creates deprecated properties for
415- # the attributes listed below, and they are temporarily attached to
416- # the _class_ in the `_setattr_cm` call. These can both be removed
417- # once the deprecation expires
418- name : _api .deprecated ('3.4' , name = name ,
419- alternative = f'self.axes.{ name } ' )(
420- property (lambda self , _value = getattr (self , name ): _value ))
421- for name in ['M' , 'vvec' , 'eye' , 'get_axis_position' ]
422- }
423-
424- with cbook ._setattr_cm (type (renderer ), ** props3d ):
425- def do_3d_projection (artist ):
426- """
427- Call `do_3d_projection` on an *artist*.
428- """
429- return artist .do_3d_projection ()
430-
431- collections_and_patches = (
432- artist for artist in self ._children
433- if isinstance (artist , (mcoll .Collection , mpatches .Patch ))
434- and artist .get_visible ())
435- if self .computed_zorder :
436- # Calculate projection of collections and patches and zorder
437- # them. Make sure they are drawn above the grids.
438- zorder_offset = max (axis .get_zorder ()
439- for axis in self ._get_axis_list ()) + 1
440- collection_zorder = patch_zorder = zorder_offset
441- for artist in sorted (collections_and_patches ,
442- key = do_3d_projection ,
443- reverse = True ):
444- if isinstance (artist , mcoll .Collection ):
445- artist .zorder = collection_zorder
446- collection_zorder += 1
447- elif isinstance (artist , mpatches .Patch ):
448- artist .zorder = patch_zorder
449- patch_zorder += 1
450- else :
451- for artist in collections_and_patches :
452- artist .do_3d_projection ()
453-
454- if self ._axis3don :
455- # Draw panes first
456- for axis in self ._get_axis_list ():
457- axis .draw_pane (renderer )
458- # Then axes
459- for axis in self ._get_axis_list ():
460- axis .draw (renderer )
461-
462- # Then rest
463- super ().draw (renderer )
408+
409+ collections_and_patches = (
410+ artist for artist in self ._children
411+ if isinstance (artist , (mcoll .Collection , mpatches .Patch ))
412+ and artist .get_visible ())
413+ if self .computed_zorder :
414+ # Calculate projection of collections and patches and zorder
415+ # them. Make sure they are drawn above the grids.
416+ zorder_offset = max (axis .get_zorder ()
417+ for axis in self ._get_axis_list ()) + 1
418+ collection_zorder = patch_zorder = zorder_offset
419+
420+ for artist in sorted (collections_and_patches ,
421+ key = lambda artist : artist .do_3d_projection (),
422+ reverse = True ):
423+ if isinstance (artist , mcoll .Collection ):
424+ artist .zorder = collection_zorder
425+ collection_zorder += 1
426+ elif isinstance (artist , mpatches .Patch ):
427+ artist .zorder = patch_zorder
428+ patch_zorder += 1
429+ else :
430+ for artist in collections_and_patches :
431+ artist .do_3d_projection ()
432+
433+ if self ._axis3don :
434+ # Draw panes first
435+ for axis in self ._get_axis_list ():
436+ axis .draw_pane (renderer )
437+ # Then axes
438+ for axis in self ._get_axis_list ():
439+ axis .draw (renderer )
440+
441+ # Then rest
442+ super ().draw (renderer )
464443
465444 def get_axis_position (self ):
466445 vals = self .get_w_lims ()
0 commit comments