I want to display images using different color maps in different figures.
Following code displays the image with two different windows but the same color map
import scipy.misc
from pylab import *
a = scipy.misc.imread('lena.jpg')
figure(1)
image = mean(a,axis=2)
imshow(image)
#if I call show() here then only one window is displayed
gray() #change the default colormap to gray
figure(2)
imshow(image)
show()
I am wondering if anyone can please help me.
Thanks a lot.
You can pass the
cmapargument to the imshow function. Look at http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.imshow