matplotlib plt.imshow画图并设置颜色

import matplotlib.pyplot as plt 
import matplotlib as mpl 

colors = ['white', 'blue', 'cyan', 'Lime','yellow'] 
cmap = mpl.colors.ListedColormap(colors)

plt.imshow(a1[num1, :, :], cmap=cmap)  

 

你可能感兴趣的:(python,#,Matplotlib)