title: Reproducing OpenCV imshow() and waitKey() with matplotlib
body: <p>The following code works well on Windows but I need to run it on Ubuntu and it seems that <code>cv2.imshow()</code> is not supported. I'm looking for an alternative using <strong>matplotlib</strong> or <strong>any other library which runs on Ubuntu</strong>.</p>
  
  <p>It works as follows :</p>
  
  <p>I have a list of frames, a frame being a <code>numpy</code> array representing an RGB image. I loop trough the frames, show the current one with <code>cv2.imshow()</code> and use <code>waitKey()</code> to register an action, either keep the frame (append it to another list) or dismiss it. I need the image to appear in the same window as the others.</p>
  
  <p>The code :</p>
  
  <pre><code>"""
      frames is a list of 3-d numpy array representing an RGB image.
  """
  keeped_frames = []
  frame_index = 0
  frames_upper_bound = len(frames)
  for frame in frames:
      print('Showing frame {} / {}'.format(frame_index + 1,frames_upper_bound))
      cv2.imshow('frame', frame)
      key = cv2.waitKey(0) &amp; 0xFF
      if key == ord('0'):
          print('Not appending frame {} / {} to list'.format(frame_index + 1, frames_upper_bound))
      elif key == ord('1'):
          print('Appending frame {} / {} to list'.format(frame_index + 1, frames_upper_bound))
          keeped_frames.append(frame)
      elif key == ord('q'):
          cv2.destroyAllWindows()
          break
      frame_index += 1
  </code></pre>
  
  <p>I tried with <code>plt.imshow()</code> on a loop but it creates new windows every time. Even if this is fixed, how can I easily register keyboard action and quickly switch to the next frame?
  With <code>cv2</code> it works really well, I can keep the key down and frames just pass pretty fast; since I need to annotate thousands of frames this way, I'd like something similar.</p>
  
  <p>Can I replicate this behavior with matplotlib or any other library wich runs on Ubuntu ?</p>