Exception with FuncAnimation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Exception with FuncAnimation

David Aldrich

Hi

 

My matplotlib script, that runs on Windows, runs to annimations:

 

anim = []

 

anim.append( matplotlib.animation.FuncAnimation(fig_ul, updatePlots_ul, frames=None, interval=100, repeat=True) )

anim.append( matplotlib.animation.FuncAnimation(fig_dl, updatePlots_dl, frames=None, interval=100, repeat=True) )

 

plt.show()      # line 476

 

When I terminate the script by closing one of the figures I get an exception:

 

Traceback (most recent call last):

  File "tcpClient.py", line 476, in <module>

    plt.show()

  File "C:\Program Files (x86)\Python36-32\lib\site-packages\matplotlib\pyplot.py", line 253, in show

    return _show(*args, **kw)

  File "C:\Program Files (x86)\Python36-32\lib\site-packages\matplotlib\backend_bases.py", line 163, in __call__

    manager.show()

  File "C:\Program Files (x86)\Python36-32\lib\site-packages\matplotlib\backends\backend_tkagg.py", line 610, in show

    self.canvas.manager.window.attributes('-topmost', 1)

AttributeError: 'NoneType' object has no attribute 'attributes'

 

How could I improve my code to avoid this untidy exception?

 

Best regards

 

David

 


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users