2015-01-09 86 views

回答

2

您需要使用繪圖軟件包來執行此操作。例如,與matplotlib:

import numpy as np 
import matplotlib.pyplot as plt 
import matplotlib.cm as cm 

X = 100*np.random.rand(6,6) 

fig, ax = plt.subplots() 
i = ax.imshow(X, cmap=cm.jet, interpolation='nearest') 
fig.colorbar(i) 

plt.show() 

enter image description here