title: Python matplotlib imshow is slow
body: <p>I want to display an image file using imshow. It is an 1600x1200 grayscale image and I found out that matplotlib uses float32 to decode the values. It takes about 2 seconds to load the image and I would like to know if there is any way to make this faster. The point is that I do not really need a high resolution image, I just want to mark certain points and draw the image as a background. So,  </p>
  
  <ul>
  <li>First question: Is 2 seconds a good performance for such an image or
  can I speed up.</li>
  <li>Second question: If it is good performance how can I make the process
  faster by reducing the resolution. Important point: I still want the
  image to strech over 1600x1200 Pixel in the end.</li>
  </ul>
  
  <p>My code:</p>
  
  <pre><code>import matplotlib
  import numpy
  
  plotfig     = matplotlib.pyplot.figure()
  plotwindow  = plotfig.add_subplot(111)
  plotwindow.axis([0,1600,0,1200])
  plotwindow.invert_yaxis() 
  img = matplotlib.pyplot.imread("lowres.png")
  im  = matplotlib.pyplot.imshow(img,cmap=matplotlib.cm.gray,origin='centre')
  plotfig.set_figwidth(200.0)
  plotfig.canvas.draw()
  matplotlib.pyplot.show()
  </code></pre>
  
  <p>This is what I want to do. Now if the picture saved in lowres.png has a lower resolution as 1600x1200 (i.e. 400x300) it is displayed in the upper corner as it should. How can I scale it to the whole are of 1600x1200 pixel? 
  If I run this program the slow part comes from the canvas.draw() command below. Is there maybe a way to speed up this command?</p>
  
  <p>Thank you in advance!</p>
  
  <p><strong>According to your suggestions</strong> I have updated to the newest version of matplotlib</p>
  
  <blockquote>
    <p>version 1.1.0svn, checkout 8988</p>
  </blockquote>
  
  <p>And I also use the following code:</p>
  
  <pre><code>img = matplotlib.pyplot.imread(pngfile)
  img *= 255
  img2 = img.astype(numpy.uint8)
  im  = self.plotwindow.imshow(img2,cmap=matplotlib.cm.gray, origin='centre')
  </code></pre>
  
  <p>and still it takes about 2 seconds to display the image... Any other ideas?</p>
  
  <p><strong>Just to add:</strong> I found the following feature</p>
  
  <p><a href="http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axesgrid" rel="nofollow">zoomed_inset_axes</a></p>
  
  <p>So in principle matplotlib should be able to do the task. There one can also plot a picture in a "zoomed" fashion...</p>