Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Also warn in pyplot.colorbar (by falling back to Figure.colorbar).
  • Loading branch information
anntzer committed Jul 6, 2020
commit fa96f30d221cc4124194c1d8acebc8c5390bb9bb
14 changes: 7 additions & 7 deletions doc/api/next_api_changes/deprecations/12443-AL.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Figure.colorbar now warns when the mappable's axes is different from the current axes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``colorbar`` now warns when the mappable's axes is different from the current axes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Currently, `.Figure.colorbar` steals space by default from the current axes
to place the colorbar. In a future version, it will steal space from the
mappable's axes instead. In preparation for this change, `.Figure.colorbar`
now emits a warning when the current axes is not the same as the mappable's
axes.
Currently, `.Figure.colorbar` and `.pyplot.colorbar` steal space by default
from the current axes to place the colorbar. In a future version, they will
steal space from the mappable's axes instead. In preparation for this change,
`.Figure.colorbar` and `.pyplot.colorbar` now emits a warning when the current
axes is not the same as the mappable's axes.
2 changes: 0 additions & 2 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2181,8 +2181,6 @@ def colorbar(mappable=None, cax=None, ax=None, **kw):
'creation. First define a mappable such as '
'an image (with imshow) or a contour set ('
'with contourf).')
if ax is None:
ax = gca()
ret = gcf().colorbar(mappable, cax=cax, ax=ax, **kw)
return ret

Expand Down