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 3
3
4
4
import numpy as np
5
5
6
- from matplotlib import _api
6
+ from matplotlib import _api , cbook
7
7
from matplotlib .gridspec import SubplotSpec
8
8
9
9
from .axes_divider import Size , SubplotDivider , Divider
@@ -43,10 +43,14 @@ def cla(self):
43
43
self .orientation = orientation
44
44
45
45
46
+ @_api .deprecated ("3.5" )
46
47
class CbarAxes (CbarAxesBase , Axes ):
47
48
pass
48
49
49
50
51
+ _cbaraxes_class_factory = cbook ._make_class_factory (CbarAxesBase , "Cbar{}" )
52
+
53
+
50
54
class Grid :
51
55
"""
52
56
A grid of Axes.
@@ -310,8 +314,6 @@ def get_vsize_hsize(self):
310
314
class ImageGrid (Grid ):
311
315
# docstring inherited
312
316
313
- _defaultCbarAxesClass = CbarAxes
314
-
315
317
def __init__ (self , fig ,
316
318
rect ,
317
319
nrows_ncols ,
@@ -416,7 +418,7 @@ def _init_locators(self):
416
418
else :
417
419
self ._colorbar_pad = self ._vert_pad_size .fixed_size
418
420
self .cbar_axes = [
419
- self ._defaultCbarAxesClass (
421
+ _cbaraxes_class_factory ( self ._defaultAxesClass ) (
420
422
self .axes_all [0 ].figure , self ._divider .get_position (),
421
423
orientation = self ._colorbar_location )
422
424
for _ in range (self .ngrids )]
Original file line number Diff line number Diff line change
1
+ from matplotlib import _api
1
2
import mpl_toolkits .axes_grid1 .axes_grid as axes_grid_orig
2
3
from .axislines import Axes
3
4
4
5
6
+ @_api .deprecated ("3.5" )
5
7
class CbarAxes (axes_grid_orig .CbarAxesBase , Axes ):
6
8
pass
7
9
@@ -12,7 +14,6 @@ class Grid(axes_grid_orig.Grid):
12
14
13
15
class ImageGrid (axes_grid_orig .ImageGrid ):
14
16
_defaultAxesClass = Axes
15
- _defaultCbarAxesClass = CbarAxes
16
17
17
18
18
19
AxesGrid = ImageGrid
You can’t perform that action at this time.
0 commit comments