title: Embedding a live updating matplotlib graph in wxpython
body: <p>I am a newbie into wx python. The following is the code to plot live graph from a text file which can be updated live. Can anybody please help me to embed this code into a wx frame. I desperately need it for my project.</p>
  
  <pre><code>import matplotlib.pyplot as plt  
  import matplotlib.animation as animation
  import time
  
  fig= plt.figure()
  ax1=fig.add_subplot(1,1,1)
  
  def animate(i):
      pullData= open('C:/test/e.txt','r').read()
      dataArray= pullData.split('\n')
      xar=[]
      yar=[]
      for eachLine in dataArray:
          if len(eachLine)&gt;1:
              x,y= eachLine.split(',')
              xar.append(int(x)) 
              yar.append(int(y))
      ax1.clear()
      ax1.plot(xar,yar)
  ani= animation.FuncAnimation(fig,animate, interval=1000)
  plt.show()
  </code></pre>