title: Simple animation of 2D coordinates using matplotlib and pyplot
body: <p>I am new to matplotlib. I have a list of x-y coordinates that I update in python and want to animate using matplotlib's pyplot. I want to specify the x-range and y-range in advance. Below is my current code:</p>
  
  <pre><code>import matplotlib.pyplot as plt
  x=[1,2,3,4]
  y=[5,6,7,8]
  for t in range(100):
      #lists x and y get updated here
      #...
  plt.plot(x, y, marker='o', linestyle='None')
  plt.show()
  </code></pre>
  
  <p>As you can see, I use <code>plt.plot()</code> and <code>plt.show()</code> <em>at the end of my iteration loop</em> to plot only the final coordinates. But I want to put this step <em>inside</em> the loop and plot at every iteration with a specified pause time so that I have an animation as the loop runs.</p>
  
  <p>Just moving that statement inside the loop or tweaks thereabout aren't working.
  I want to keep it very simple though, and don't want to use <code>matplotlib.animation</code>. Is there some simple method without using many more modules and libraries (only stuff like <code>plt.pause()</code> and perhaps only a bit more) that will let me do what I want?</p>
  
  <p>I looked at many places online, and the problem I face with most methods there is that I am using python(x,y) (that's python version 2.7) on Windows for this, and animations using too complicated modules and libraries are crashing here. </p>
  
  <p>However, I am able to run simple stuff like <a href="http://matplotlib.sourceforge.net/examples/animation/random_data.html" rel="noreferrer">this example</a> on the matplotlib site, which is close to what I want, but not quite. So perhaps the best thing will be a modification of this example that works for my case of 2D data (that example is for a 1D row). But any other suggestion is welcome.</p>