title: Dynamic plot works in IDLE, but not jupyter notebook
body: <p>The code below works fine when running through idle (Python 3.6 idle)</p>
  
  <pre><code>import matplotlib.pyplot as plt
  import time
  import random
  #%matplotlib inline
  
  ysample = random.sample(range(-50, 50), 100)
  
  xdata = []
  ydata = []
  
  plt.show()
  
  axes = plt.gca()
  axes.set_xlim(0, 100)
  axes.set_ylim(-50, +50)
  line, = axes.plot(xdata, ydata, 'r-')
  
  for i in range(100):
      xdata.append(i)
      ydata.append(ysample[i])
      line.set_xdata(xdata)
      line.set_ydata(ydata)
      plt.draw()
      plt.pause(1e-17)
      time.sleep(0.1)
  
  # add this if you don't want the window to disappear at the end
  plt.show()
  </code></pre>
  
  <p>When transferring this code to jupyter notebook, I'm adding the magic command</p>
  
  <p><code>%matplotlib notebook</code>  which I'm told should be used for dynamic plots. </p>
  
  <p>(I tried %matplotlib inline, but I end up with a static plot)</p>
  
  <p>However, I'm ending up with this error</p>
  
  <pre><code> NotImplementedError                       Traceback (most recent call last)
  &lt;ipython-input-7-2f88f762e22a&gt; in &lt;module&gt;()
       22     line.set_ydata(ydata)
       23     plt.draw()
  ---&gt; 24     plt.pause(1e-17)
       25     time.sleep(0.1)
       26 
  
   C:\Users\Moondra\AppData\Local\Programs\Python\Python36\lib\site-
     packages\matplotlib\pyplot.py in pause(interval)
      298                 canvas.draw()
      299             show(block=False)
  --&gt; 300             canvas.start_event_loop(interval)
      301             return
      302 
  
  C:\Users\Moondra\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\backends\backend_nbagg.py in start_event_loop(self, timeout)
      192 
       193     def start_event_loop(self, timeout):
  --&gt; 194         FigureCanvasBase.start_event_loop_default(self, timeout)
      195 
      196     def stop_event_loop(self):
  
  C:\Users\Moondra\AppData\Local\Programs\Python\Python36\lib\site-
  packages\matplotlib\backend_bases.py in start_event_loop_default(self, timeout)
     2451         self._looping = True
     2452         while self._looping and counter * timestep &lt; timeout:
  -&gt; 2453             self.flush_events()
     2454             time.sleep(timestep)
     2455             counter += 1
  
       C:\Users\Moondra\AppData\Local\Programs\Python\Python36\lib\site-
   packages\matplotlib\backend_bases.py in flush_events(self)
     2400         backends with GUIs.
     2401         """
  -&gt; 2402         raise NotImplementedError
     2403 
     2404     def start_event_loop(self, timeout):
  
  NotImplementedError:`
  </code></pre>