title: Tkinter plotting slowing down in thread
body: <p>My code is below. The goal is to plot multiple random walks on to a FigureCanvasTkAgg. </p>
  
  <p>I didn't add the code for my custom Thread class based on <code>threading.Thread</code> but it simply repeats the input function on an infinite loop from <code>.starting()</code> to <code>.stopping()</code> which can be bound to buttons.</p>
  
  <p>What I find is the plotting becomes slower the further the loop runs. I believe the bottleneck is in <code>ax.plots(s)</code>, <code>plots.show()</code>, as I understand, this method effectively plots every previous plot again. This was assumed as I can call <code>ax.clear()</code> to speed up the loop again.</p>
  
  <p>Is there a different way I should be updating this image to optimize for just plotting without clearing?</p>
  
  <p>(Not as interested in optimizing the rest as they do not seem to change per loop so can't explain the slow down situation, open to correction)</p>
  
  <pre><code>import numpy as np
  import threading
  from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
  
  def Updater(ax,plots):
      s = np.zeros(400)
      for i in range(399):
          s[i+1]=s[i]+random.choice([-1, 1])
      ax.plot(s)
      plots.show()
  
  tk = Tk()
  fig = plt.figure()
  ax  = fig.add_subplot(111)
  
  plots = FigureCanvasTkAgg(fig,tk)
  plots.get_tk_widget().pack()
  
  Thread(lambda ax=ax,plots=plots: Updater(ax,plots)).starting()
  tk.mainloop()
  </code></pre>