title: What does matplotlib `imshow(interpolation='nearest')` do?
body: <p>I use <code>imshow</code> function with <code>interpolation='nearest'</code> on a grayscale image and get a nice color picture as a result, looks like it does some sort of color segmentation for me, what exactly is going on there? </p>
  
  <p>I would also like to get something like this for image processing, is there some function on numpy arrays like <code>interpolate('nearest')</code> out there?</p>
  
  <p><strong>EDIT:</strong> Please correct me if I'm wrong, it looks like it does simple pixel clustering (clusters are colors of the corresponding colormap) and the word 'nearest' says that it takes the nearest colormap color (probably in the RGB space) to decide to which cluster the pixel belongs.</p>