Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 785d66a

Browse files
committed
Added an api_changes note about the deprecation of ScalarMappable.set_colorbar
1 parent b50237d commit 785d66a

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

doc/api/api_changes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ Changes in 1.3.x
117117
position type. Previously, it would draw the right or top spine at
118118
+1 data offset.
119119

120+
* The ScalarMappable class' set_colorbar is now deprecated. Instead, the
121+
:attr:`matplotlib.cm.ScalarMappable.colorbar` attribute should be used.
122+
In previous matplotlib versions this attribute was an undocumented tuple
123+
of ``(colorbar_instance, colorbar_axes)`` but is now just
124+
``colorbar_instance``. To get the colorbar axes it is possible to just use
125+
the :attr:`~matplotlib.colorbar.ColorbarBase.ax` attribute on a colorbar
126+
isntance.
127+
120128
* In :class:`~matplotlib.patches.FancyArrow`, the default arrow head width,
121129
``head_width``, has been made larger to produce a visible arrow head. The new
122130
value of this kwarg is ``head_width = 20 * width``.

lib/matplotlib/colorbar.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,7 @@ def __init__(self, ax, cmap=None,
269269
extendrect=False,
270270
label='',
271271
):
272+
#: The axes that this colorbar lives in.
272273
self.ax = ax
273274
self._patch_ax()
274275
if cmap is None:

0 commit comments

Comments
 (0)