8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 039c94a commit 64cca8eCopy full SHA for 64cca8e
lib/matplotlib/colorbar.py
@@ -992,6 +992,12 @@ def remove(self):
992
If the colorbar was created with ``use_gridspec=True`` the previous
993
gridspec is restored.
994
"""
995
+ if hasattr(self.ax, '_colorbar_info'):
996
+ parents = self.ax._colorbar_info['parents']
997
+ for a in parents:
998
+ if self.ax in a._colorbars:
999
+ a._colorbars.remove(self.ax)
1000
+
1001
self.ax.remove()
1002
1003
self.mappable.callbacks.disconnect(self.mappable.colorbar_cid)
0 commit comments