@@ -26,25 +26,14 @@ def __init__(self, *args, orientation, **kwargs):
2626 super ().__init__ (* args , ** kwargs )
2727
2828 def colorbar (self , mappable , * , ticks = None , ** kwargs ):
29-
30- if self .orientation in ["top" , "bottom" ]:
31- orientation = "horizontal"
32- else :
33- orientation = "vertical"
34-
29+ orientation = (
30+ "horizontal" if self .orientation in ["top" , "bottom" ] else
31+ "vertical" )
3532 cb = mpl .colorbar .Colorbar (
3633 self , mappable , orientation = orientation , ticks = ticks , ** kwargs )
37- self ._cbid = mappable .colorbar_cid # deprecated in 3.3.
38- self ._locator = cb .locator # deprecated in 3.3.
39-
4034 self ._config_axes ()
4135 return cb
4236
43- cbid = _api .deprecate_privatize_attribute (
44- "3.3" , alternative = "mappable.colorbar_cid" )
45- locator = _api .deprecate_privatize_attribute (
46- "3.3" , alternative = ".colorbar().locator" )
47-
4837 def _config_axes (self ):
4938 """Make an axes patch and outline."""
5039 ax = self
@@ -80,20 +69,18 @@ class Grid:
8069
8170 _defaultAxesClass = Axes
8271
83- @_api .delete_parameter ("3.3" , "add_all" )
8472 def __init__ (self , fig ,
8573 rect ,
8674 nrows_ncols ,
8775 ngrids = None ,
8876 direction = "row" ,
8977 axes_pad = 0.02 ,
90- add_all = True ,
78+ * ,
9179 share_all = False ,
9280 share_x = True ,
9381 share_y = True ,
9482 label_mode = "L" ,
9583 axes_class = None ,
96- * ,
9784 aspect = False ,
9885 ):
9986 """
@@ -114,9 +101,6 @@ def __init__(self, fig,
114101 axes_pad : float or (float, float), default: 0.02
115102 Padding or (horizontal padding, vertical padding) between axes, in
116103 inches.
117- add_all : bool, default: True
118- Whether to add the axes to the figure using `.Figure.add_axes`.
119- This parameter is deprecated.
120104 share_all : bool, default: False
121105 Whether all axes share their x- and y-axis. Overrides *share_x*
122106 and *share_y*.
@@ -188,9 +172,8 @@ def __init__(self, fig,
188172
189173 self ._init_locators ()
190174
191- if add_all :
192- for ax in self .axes_all :
193- fig .add_axes (ax )
175+ for ax in self .axes_all :
176+ fig .add_axes (ax )
194177
195178 self .set_label_mode (label_mode )
196179
@@ -335,14 +318,13 @@ class ImageGrid(Grid):
335318
336319 _defaultCbarAxesClass = CbarAxes
337320
338- @_api .delete_parameter ("3.3" , "add_all" )
339321 def __init__ (self , fig ,
340322 rect ,
341323 nrows_ncols ,
342324 ngrids = None ,
343325 direction = "row" ,
344326 axes_pad = 0.02 ,
345- add_all = True ,
327+ * ,
346328 share_all = False ,
347329 aspect = True ,
348330 label_mode = "L" ,
@@ -372,9 +354,6 @@ def __init__(self, fig,
372354 axes_pad : float or (float, float), default: 0.02in
373355 Padding or (horizontal padding, vertical padding) between axes, in
374356 inches.
375- add_all : bool, default: True
376- Whether to add the axes to the figure using `.Figure.add_axes`.
377- This parameter is deprecated.
378357 share_all : bool, default: False
379358 Whether all axes share their x- and y-axis.
380359 aspect : bool, default: True
@@ -409,22 +388,14 @@ def __init__(self, fig,
409388 self ._colorbar_size = cbar_size
410389 # The colorbar axes are created in _init_locators().
411390
412- if add_all :
413- super ().__init__ (
414- fig , rect , nrows_ncols , ngrids ,
415- direction = direction , axes_pad = axes_pad ,
416- share_all = share_all , share_x = True , share_y = True , aspect = aspect ,
417- label_mode = label_mode , axes_class = axes_class )
418- else : # Only show deprecation in that case.
419- super ().__init__ (
420- fig , rect , nrows_ncols , ngrids ,
421- direction = direction , axes_pad = axes_pad , add_all = add_all ,
422- share_all = share_all , share_x = True , share_y = True , aspect = aspect ,
423- label_mode = label_mode , axes_class = axes_class )
424-
425- if add_all :
426- for ax in self .cbar_axes :
427- fig .add_axes (ax )
391+ super ().__init__ (
392+ fig , rect , nrows_ncols , ngrids ,
393+ direction = direction , axes_pad = axes_pad ,
394+ share_all = share_all , share_x = True , share_y = True , aspect = aspect ,
395+ label_mode = label_mode , axes_class = axes_class )
396+
397+ for ax in self .cbar_axes :
398+ fig .add_axes (ax )
428399
429400 if cbar_set_cax :
430401 if self ._colorbar_mode == "single" :
0 commit comments