1、打开Python的shell界面,也就是idle界面。
2、载入相关的工具包,这里用到了skimage和mathplot工具包:from skimage import dataimport matplotlib.pyplot as plt
3、产生一组数据并且生成一个图片:img=data.coffee()plt.figure(num='text',figsize=(8,8))
4、画出各个子图,代码如下:plt.subplot(2,2,1)plt.imshow(img)plt.subplot(2,2,2)plt.imshow(img[:,:,0])plt.subplot(2,2,3)plt.imshow(img[:,:,1])plt.subplot(2,2,4)plt.imshow(img[:,:,2])
5、采用以下指令显示我们的图片:plt.show()
6、查看显示结果如下图。