On 2012/09/23 9:45 AM, Giovanni Plantageneto wrote:
> One of the suggestions I got works:
>
>> Maybe this:
>
>> self.ax.get_figure().clf()
>> self.ax.get_figure().add_axes(self.ax)

This seems a bit dangerous, because logically, even if does not 
presently do so, the clf() call could remove the figure reference from 
self.ax.  If you want to go this route, then:

fig = self.ax.get_figure()
fig.clf()
fig.add_axes(self.ax)

Eric

>
>> But it looks really weird to me.
>
> If I understand it correctly, from matplotlib version 1.1.1 (?)
> statements as "self.ax.get_figure().axes = []" are not possible any
> more as axes are not lists anymore. Don't take my word for it, though.
>
> Thanks for the support.
>
>
> 2012/9/23 Giovanni Plantageneto <g.plantagen...@gmail.com>:
>> Hi everybody,
>> sorry, I guess the question is trivial, but I confess my matplotlib
>> and python ignorance.
>>
>> I'm running some code written by someone else, and apparently some
>> bits of the code are not compliant with newer versions of matplotlib.
>> So, how can I rewrite the following, which give AttributError?
>>
>>> self.ax.get_figure().axes = []
>>
>> and
>>
>>> self.ax.get_figure().axes = [self.ax]
>>
>> Thanks a lot.
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://ad.doubleclick.net/clk;258768047;13503038;j?
> http://info.appdynamics.com/FreeJavaPerformanceDownload.html
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://ad.doubleclick.net/clk;258768047;13503038;j?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to