code: def image_set_aspect(aspect=1.0, axes="gca"):
      
      if axes is "gca": axes = _pylab.gca()
  
      e = axes.get_images()[0].get_extent()
      axes.set_aspect(abs((e[1]-e[0])/(e[3]-e[2]))/aspect)
docs: sets the aspect ratio of the current zoom level of the imshow image