Hmmm, for some reason, I was thinking that there were general artist remove
methods for Axes and Figures, but I can't find them now. Ok, so having
cb.remove_from_figure() makes sense then.


On Wed, Jun 4, 2014 at 11:36 AM, Phil Elson <notifications@github.com>
wrote:

> In lib/matplotlib/figure.py:
>
> > @@ -1502,6 +1502,29 @@ def colorbar(self, mappable, cax=None, ax=None, use_gridspec=True, **kw):
> >          self.sca(current_ax)
> >          return cb
> >
> > +    def delcolorbar(self, cb):
>
> cb.remove_from_figure() should be all that is needed - the axes and
> figure are all accessible to the colobar class. I'm just not fond of
> putting methods on the Figure to remove objects (the same goes for
> figure.delaxes but that horse has bolted...). @WeatherGod
> <https://github.com/WeatherGod> - any reason for wanting it on the figure
> rather than on the colobar?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/matplotlib/matplotlib/pull/3110/files#r13392793>.
>