Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 96a5022

Browse filesBrowse files
committed
Remove deprecated toolkit colorbar implementation.
1 parent 1a07b9f commit 96a5022
Copy full SHA for 96a5022

File tree

Expand file treeCollapse file tree

13 files changed

+21
-874
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

13 files changed

+21
-874
lines changed
Open diff view settings
Collapse file

‎doc/api/next_api_changes/removals/18747-ES.rst‎

Copy file name to clipboardExpand all lines: doc/api/next_api_changes/removals/18747-ES.rst
+5Lines changed: 5 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ method now always uses the renderer instance cached on the `.Figure`.
4747

4848
``axes_grid1``
4949
~~~~~~~~~~~~~~
50+
The ``mpl_toolkits.axes_grid1.colorbar`` module and its colorbar implementation
51+
have been removed in favor of :mod:`matplotlib.colorbar`. Additionally:
52+
5053
- The *locator* parameter to ``colorbar()`` has been removed in favor of its
5154
synonym *ticks* (which already existed previously, and is consistent with
5255
:mod:`matplotlib.colorbar`).
56+
- The ``mpl_toolkits.legacy_colorbar`` rcParam has no effect and also has been
57+
removed.
Collapse file

‎doc/api/toolkits/axes_grid1.rst‎

Copy file name to clipboardExpand all lines: doc/api/toolkits/axes_grid1.rst
-1Lines changed: 0 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ See :ref:`axes_grid1_users-guide-index` for a guide on the usage of axes_grid1.
2929
axes_grid1.axes_grid
3030
axes_grid1.axes_rgb
3131
axes_grid1.axes_size
32-
axes_grid1.colorbar
3332
axes_grid1.inset_locator
3433
axes_grid1.mpl_axes
3534
axes_grid1.parasite_axes
Collapse file

‎examples/axes_grid1/demo_axes_grid.py‎

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_axes_grid.py
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
from mpl_toolkits.axes_grid1 import ImageGrid
1212

1313

14-
plt.rcParams["mpl_toolkits.legacy_colorbar"] = False
15-
16-
1714
def get_demo_image():
1815
z = cbook.get_sample_data("axes_grid/bivariate_normal.npy", np_load=True)
1916
# z is a numpy array of 15x15
Collapse file

‎examples/axes_grid1/demo_axes_grid2.py‎

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_axes_grid2.py
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
from mpl_toolkits.axes_grid1 import ImageGrid
1414

1515

16-
plt.rcParams["mpl_toolkits.legacy_colorbar"] = False
17-
18-
1916
def add_inner_title(ax, title, loc, **kwargs):
2017
from matplotlib.offsetbox import AnchoredText
2118
from matplotlib.patheffects import withStroke
Collapse file

‎examples/axes_grid1/demo_edge_colorbar.py‎

Copy file name to clipboardExpand all lines: examples/axes_grid1/demo_edge_colorbar.py
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
from mpl_toolkits.axes_grid1 import AxesGrid
1313

1414

15-
plt.rcParams["mpl_toolkits.legacy_colorbar"] = False
16-
17-
1815
def get_demo_image():
1916
z = cbook.get_sample_data("axes_grid/bivariate_normal.npy", np_load=True)
2017
# z is a numpy array of 15x15
Collapse file

‎lib/matplotlib/__init__.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@ def gen_candidates():
569569
# rcParams deprecated; some can manually be mapped to another key.
570570
# Values are tuples of (version, new_name_or_None).
571571
_deprecated_ignore_map = {
572+
'mpl_toolkits.legacy_colorbar': ('3.4', None),
572573
}
573574

574575
# rcParams deprecated; can use None to suppress warnings; remain actually
Collapse file

‎lib/matplotlib/rcsetup.py‎

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,8 +1441,6 @@ def _convert_validator_spec(key, conv):
14411441
# Additional arguments for convert movie writer (using pipes)
14421442
"animation.convert_args": validate_stringlist,
14431443

1444-
"mpl_toolkits.legacy_colorbar": validate_bool,
1445-
14461444
# Classic (pre 2.0) compatibility mode
14471445
# This is used for things that are hard to make backward compatible
14481446
# with a sane rcParam alone. This does *not* turn on classic mode
Collapse file

‎lib/mpl_toolkits/axes_grid/colorbar.py‎

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axes_grid/colorbar.py
-5Lines changed: 0 additions & 5 deletions
This file was deleted.
Collapse file

‎lib/mpl_toolkits/axes_grid1/axes_grid.py‎

Copy file name to clipboardExpand all lines: lib/mpl_toolkits/axes_grid1/axes_grid.py
+5-22Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import numpy as np
55

66
import matplotlib as mpl
7-
from matplotlib import _api, cbook, ticker
7+
from matplotlib import _api, cbook
88
from matplotlib.gridspec import SubplotSpec
99

1010
from .axes_divider import Size, SubplotDivider, Divider
@@ -32,27 +32,10 @@ def colorbar(self, mappable, *, ticks=None, **kwargs):
3232
else:
3333
orientation = "vertical"
3434

35-
if mpl.rcParams["mpl_toolkits.legacy_colorbar"]:
36-
cbook.warn_deprecated(
37-
"3.2", message="Since %(since)s, mpl_toolkits's own colorbar "
38-
"implementation is deprecated; it will be removed "
39-
"%(removal)s. Set the 'mpl_toolkits.legacy_colorbar' rcParam "
40-
"to False to use Matplotlib's default colorbar implementation "
41-
"and suppress this deprecation warning.")
42-
if ticks is None:
43-
ticks = ticker.MaxNLocator(5) # For backcompat.
44-
from .colorbar import Colorbar
45-
cb = Colorbar(
46-
self, mappable, orientation=orientation, ticks=ticks, **kwargs)
47-
self._cbid = mappable.callbacksSM.connect(
48-
'changed', cb.update_normal)
49-
mappable.colorbar = cb
50-
self._locator = cb.cbar_axis.get_major_locator()
51-
else:
52-
cb = mpl.colorbar.Colorbar(
53-
self, mappable, orientation=orientation, ticks=ticks, **kwargs)
54-
self._cbid = mappable.colorbar_cid # deprecated.
55-
self._locator = cb.locator # deprecated.
35+
cb = mpl.colorbar.Colorbar(
36+
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.
5639

5740
self._config_axes()
5841
return cb

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.