title: Matplotlib update a graph with new data, graph does not show
body: <p>I have much the same problem as this guy: <a href="https://stackoverflow.com/questions/10944621/dynamically-updating-plot-in-matplotlib">Dynamically updating plot in matplotlib</a>. I want to update a graph with data from a serial port and I have been trying to implement this answer, but I can't get a MWE to work. The graph simply doesn't appear, but everything else seems to work. I have read about problems with the installation of Matplotlib causing similar symptoms.</p>
  
  <p>Here is my Minimum Not Working Example (MNWE):</p>
  
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  
  fig1 = plt.figure() #Create figure
  
  l, = plt.plot([], [], 'r-') #What is the comma for? Is l some kind of struct/class?
  plt.xlim(0, 1)
  plt.ylim(0, 1)
  plt.xlabel('x')
  plt.title('test')
  
  k = 5
  xdata=[0.5 for i in range(k+1)]     # Generate a list to hold data
  ydata=[j for j in range(k+1)]
  
  while True:
      y = float(raw_input("y val :"))
      xdata.append(y)     # Append new data to list
      k = k + 1       # inc x value
      ydata.append(k)
      l.set_data(xdata,ydata) # update data
      print xdata     # Print for debug perposes
      print ydata
      plt.draw        # These seem to do nothing
      plt.show        # !?
  </code></pre>
  
  <p>Could someone please point me in the right direction / provide a link / tell me what to google? I'm lost. Thanks</p>