@@ -49,7 +49,7 @@ class Axes3D(Axes):
49
49
def __init__ (
50
50
self , fig , rect = None , * args ,
51
51
azim = - 60 , elev = 30 , sharez = None , proj_type = 'persp' ,
52
- box_aspect = None , force_zorder = False ,
52
+ box_aspect = None , computed_zorder = True ,
53
53
** kwargs ):
54
54
"""
55
55
Parameters
@@ -66,10 +66,10 @@ def __init__(
66
66
Other axes to share z-limits with.
67
67
proj_type : {'persp', 'ortho'}
68
68
The projection type, default 'persp'.
69
- force_zorder : bool, optional
70
- Force use of each collection and patch's zorder to determine
71
- draw order. If this option is True, automatic draw order is
72
- completely disabled . Defaults to False .
69
+ computed_zorder : bool, optional
70
+ If this option is True, draw order is computed automatically.
71
+ Otherwise, each collection and patch's zorder is used to determine
72
+ draw order . Defaults to True .
73
73
auto_add_to_figure : bool, default: True
74
74
Prior to Matplotlib 3.4 Axes3D would add themselves
75
75
to their host Figure on init. Other Axes class do not
@@ -89,7 +89,7 @@ def __init__(
89
89
.. versionadded:: 1.2.1
90
90
The *sharez* parameter.
91
91
.. versionadded:: TBD
92
- The *force_zorder * parameter.
92
+ The *computed_zorder * parameter.
93
93
"""
94
94
95
95
if rect is None :
@@ -98,7 +98,7 @@ def __init__(
98
98
self .initial_azim = azim
99
99
self .initial_elev = elev
100
100
self .set_proj_type (proj_type )
101
- self .force_zorder = force_zorder
101
+ self .computed_zorder = computed_zorder
102
102
103
103
self .xy_viewLim = Bbox .unit ()
104
104
self .zz_viewLim = Bbox .unit ()
@@ -484,26 +484,26 @@ def do_3d_projection(artist):
484
484
"%(since)s and will be removed %(removal)s." )
485
485
return artist .do_3d_projection (renderer )
486
486
487
- if self .force_zorder :
488
- for col in self .collections :
489
- col .do_3d_projection ()
490
- for patch in self .patches :
491
- patch .do_3d_projection ()
492
- else :
493
- # Calculate projection of collections and patches and zorder them.
494
- # Make sure they are drawn above the grids.
487
+ if self .computed_zorder :
488
+ # Calculate projection of collections and patches and zorder
489
+ # them. Make sure they are drawn above the grids.
495
490
zorder_offset = max (axis .get_zorder ()
496
491
for axis in self ._get_axis_list ()) + 1
497
492
for i , col in enumerate (
498
493
sorted (self .collections ,
499
- key = do_3d_projection ,
500
- reverse = True )):
494
+ key = do_3d_projection ,
495
+ reverse = True )):
501
496
col .zorder = zorder_offset + i
502
497
for i , patch in enumerate (
503
498
sorted (self .patches ,
504
- key = do_3d_projection ,
505
- reverse = True )):
499
+ key = do_3d_projection ,
500
+ reverse = True )):
506
501
patch .zorder = zorder_offset + i
502
+ else :
503
+ for col in self .collections :
504
+ col .do_3d_projection ()
505
+ for patch in self .patches :
506
+ patch .do_3d_projection ()
507
507
508
508
if self ._axis3don :
509
509
# Draw panes first
@@ -3518,6 +3518,7 @@ def stem(self, x, y, z, *, linefmt='C0-', markerfmt='C0o', basefmt='C3-',
3518
3518
3519
3519
stem3D = stem
3520
3520
3521
+
3521
3522
docstring .interpd .update (Axes3D_kwdoc = artist .kwdoc (Axes3D ))
3522
3523
docstring .dedent_interpd (Axes3D .__init__ )
3523
3524
0 commit comments