code: def image_coarsen(xlevel=0, ylevel=0, image="auto", method='average'):
      
      if image == "auto": image = _pylab.gca().images[0]
  
      Z = _n.array(image.get_array())
  
      # store this image in the undo list
      global image_undo_list
      image_undo_list.append([image, Z])
      if len(image_undo_list) > 10: image_undo_list.pop(0)
  
      # images have transposed data
      image.set_array(_fun.coarsen_matrix(Z, ylevel, xlevel, method))
  
      # update the plot
      _pylab.draw()
docs: This will coarsen the image data by binning each xlevel+1 along the x-axis
      and each ylevel+1 points along the y-axis
  
      type can be 'average', 'min', or 'max'