On Sunday, September 23, 2012, Giovanni Plantageneto wrote:
> 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.
>
>
Without context, it would be hard to say. What was the exception message?
I bet it was a NoneType object being returned by get_figure(), which would
mean that the Axes object was created without a figure, which is rarely
done.
Also, it looks like the code was trying to manage the hierarchy of objects
itself (maybe the code was trying to detach an axes from one figure and
transfer to another? Lots of bookkeeping code like this is not needed, but
you may still have other issues lurking.
Ben Root
------------------------------------------------------------------------------
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