|
4 | 4 | import numpy as np |
5 | 5 |
|
6 | 6 | import matplotlib as mpl |
7 | | -from matplotlib import _api, cbook, ticker |
| 7 | +from matplotlib import _api, cbook |
8 | 8 | from matplotlib.gridspec import SubplotSpec |
9 | 9 |
|
10 | 10 | from .axes_divider import Size, SubplotDivider, Divider |
@@ -32,27 +32,10 @@ def colorbar(self, mappable, *, ticks=None, **kwargs): |
32 | 32 | else: |
33 | 33 | orientation = "vertical" |
34 | 34 |
|
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. |
56 | 39 |
|
57 | 40 | self._config_axes() |
58 | 41 | return cb |
|
0 commit comments