0
我有一個11x9的float
的numpy矩陣,我想把它想象成一個「熱圖」。如何更改matplotlib圖的軸值?
數據例如:
>>> print(result)
[[ 0.11686587 0.27755644 0.5768039 0.65205843 0.75033201 0.8145197
0.77202302 0.64099159 0.39442231]
[ 0.27888446 0.55511288 0.6728641 0.77335104 0.85391766 0.91633466
0.94510846 0.96901284 0.9729969 ]
[ 0.55599823 0.68171757 0.77512174 0.89287295 0.937583 0.94643648
0.96768482 0.97742364 0.97919433]
[ 0.6644533 0.76803896 0.895529 0.94510846 0.96370075 0.97211155
0.97786631 0.97919433 0.97919433]
[ 0.77290837 0.86586985 0.94953519 0.96945551 0.97698097 0.97786631
0.97786631 0.97919433 0.97919433]
[ 0.85214697 0.94245241 0.9747676 0.97653829 0.97786631 0.97786631
0.97919433 0.97919433 0.97919433]
[ 0.94200974 0.96724214 0.97565294 0.97653829 0.97609562 0.97786631
0.97919433 0.97919433 0.97919433]
[ 0.95883134 0.97255423 0.97609562 0.97742364 0.97786631 0.97786631
0.97919433 0.97919433 0.97919433]
[ 0.97166888 0.97343958 0.9747676 0.96104471 0.97830899 0.97919433
0.97919433 0.97919433 0.97919433]
[ 0.9729969 0.97565294 0.9747676 0.97255423 0.97078353 0.97919433
0.97919433 0.97919433 0.97919433]
[ 0.97078353 0.97565294 0.9747676 0.97078353 0.96989819 0.97919433
0.97919433 0.97919433 0.97919433]]
到目前爲止我通過使用繪製它:
import matplotlib.pyplot as plt
plt.matshow(result)
plt.show()
的問題是,所述軸被編號爲0至10,並從0至9.我想以10^-5至10^5等數字對數。
它有可能嗎?我不是指軸標籤,而是軸上的顯示值。
這實際上只適用於軸對象,但它幫助我google正確的東西,thnkas – petrbel