title: Matplotlib savefig to cStreamIO then load the data into another Matplotlib plot/fig Python 2.7
body: <p>Attempting to use matplotlib to write out to an iostream then display that data in another matplotlib plot (started by following: <a href="https://stackoverflow.com/questions/14824522/dynamically-serving-a-matplotlib-image-to-the-web-using-python">Write Matplotlib savefig to html</a>).  For efficiency purposes, I want to avoid writing the image to disk.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>import cStringIO
  import matplotlib.pyplot as plt
  import matplotlib.pyplot as plt2
  import matplotlib.image as mpimg
  
  sio = cStringIO.StringIO()
  plt.savefig(sio, format='png')
  
  # I should mention at this point here that the sio object is sent through a 
  # pipe between two processes (so it has been pickled)    
  
  imgplt = plt2.imshow(mpimg.imread(sio.getvalue().encode("base64").strip()))
  # this line generates the following error.  As well as several variations 
  #   including specifying 'png'
  </code></pre>
  
  <p>The error returned is:
    IOError: [Errno 22] invalid mode ('rb') or filename: 'iVBORw...followed by a long string with the data from the image'</p>
  
  <p>I looked at the image.py file and it appears to be looking for a filename.  </p>
  
  <p>Thanks for taking a look.</p>