title: matplotlib.animation - AttributeError: 'NoneType' object has no attribute 'new_timer'
body: <p>The code below is a snippet of the code i have written, It basically shows a graph in a tkinter window but then struggles when it comes to adding animation(updating) the graph. The following is the error i keep getting, any help would be much appreciated.</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Users\nasto\Documents\Company\CMSFRAME.py", line 163, in &lt;module&gt;
      ani = animation.FuncAnimation (f, animate, interval=1000)
    File "C:\Users\nasto\AppData\Local\Programs\Python\Python36-32\lib\site-packages\matplotlib\animation.py", line 1462, in __init__
      TimedAnimation.__init__(self, fig, **kwargs)
    File "C:\Users\nasto\AppData\Local\Programs\Python\Python36-32\lib\site-packages\matplotlib\animation.py", line 1225, in __init__
      event_source = fig.canvas.new_timer()
  AttributeError: 'NoneType' object has no attribute 'new_timer'
  </code></pre>
  
  <hr>
  
  <p>The snippet of my code:</p>
  
  <pre><code>      canvas =  FigureCanvasTkAgg(f, self)
        canvas.show()
        canvas.get_tk_widget().pack(side=tk.LEFT,  fill=tk.BOTH, expand = True)
        toolbar = NavigationToolbar2TkAgg(canvas, self)
        toolbar.update()
        canvas._tkcanvas.pack(side=tk.LEFT,  fill=tk.BOTH, expand = True)
  
  f = Figure(figsize = (5,5), dpi=100)
  a = f.add_subplot(111)
  
  def  animate(interval):
      pullData = open('financeData.txt','r').read()
      dataList = pullData.split('\n')
      xList = []
      yList=[]
      for eachLine in dataList:
          if len(eachline) &gt;1:
              x,  y = eachLine.split(',')
              xList.append(int(x))
              yList.append(int(x))
      a.clear()
      a.plot(xList, yList)
  
  app = start()
  ani = animation.FuncAnimation (f, animate, interval=1000)
  </code></pre>