File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed
doc/api/next_api_changes/deprecations Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 1+ ``axes_grid1.axes_grid.CbarAxes `` and ``axes_grid1.axisartist.CbarAxes ``
2+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+ These classes are deprecated (they are now dynamically generated based on the
4+ owning axes class).
Original file line number Diff line number Diff line change 33
44import numpy as np
55
6- from matplotlib import _api
6+ from matplotlib import _api , cbook
77from matplotlib .gridspec import SubplotSpec
88
99from .axes_divider import Size , SubplotDivider , Divider
@@ -43,10 +43,14 @@ def cla(self):
4343 self .orientation = orientation
4444
4545
46+ @_api .deprecated ("3.5" )
4647class CbarAxes (CbarAxesBase , Axes ):
4748 pass
4849
4950
51+ _cbaraxes_class_factory = cbook ._make_class_factory (CbarAxesBase , "Cbar{}" )
52+
53+
5054class Grid :
5155 """
5256 A grid of Axes.
@@ -310,8 +314,6 @@ def get_vsize_hsize(self):
310314class ImageGrid (Grid ):
311315 # docstring inherited
312316
313- _defaultCbarAxesClass = CbarAxes
314-
315317 def __init__ (self , fig ,
316318 rect ,
317319 nrows_ncols ,
@@ -416,7 +418,7 @@ def _init_locators(self):
416418 else :
417419 self ._colorbar_pad = self ._vert_pad_size .fixed_size
418420 self .cbar_axes = [
419- self ._defaultCbarAxesClass (
421+ _cbaraxes_class_factory ( self ._defaultAxesClass ) (
420422 self .axes_all [0 ].figure , self ._divider .get_position (),
421423 orientation = self ._colorbar_location )
422424 for _ in range (self .ngrids )]
Original file line number Diff line number Diff line change 1+ from matplotlib import _api
12import mpl_toolkits .axes_grid1 .axes_grid as axes_grid_orig
23from .axislines import Axes
34
45
6+ @_api .deprecated ("3.5" )
57class CbarAxes (axes_grid_orig .CbarAxesBase , Axes ):
68 pass
79
@@ -12,7 +14,6 @@ class Grid(axes_grid_orig.Grid):
1214
1315class ImageGrid (axes_grid_orig .ImageGrid ):
1416 _defaultAxesClass = Axes
15- _defaultCbarAxesClass = CbarAxes
1617
1718
1819AxesGrid = ImageGrid
You can’t perform that action at this time.
0 commit comments