Let's look at example of special plots: image contours and image histograms.Visualizing image ISO-contours of other 2D functions can be very useful.This needs gray scale images, because the contours need to be taken on a single value for every coordinate[x,y]. here's how to do it.
from PIL import Image
from pylab import *
im = array(Image.open('test.jpg').convert('L')) # read image to arry
figure() # create a new figure
gray() # don't use colors
#show contours with orgin upper left corner
contour(im,origin ='image')
axis('equal')
axis('off')
figure()
hist(im.flatten(),128)
show()
As before,the PIL method convert() does convection to gray-scale.An image histogram is a p