我有一個浮動列表範圍從0.01到1.0。我將它們分配給矩陣上的特定點。在我將它們分配到某一點時,它們覆蓋了整個顏色譜圖1.0,從黑到白都是0.我怎樣才能使它們只覆蓋綠色和紅色。漂浮在一個矩陣顏色紅色到綠色
for x, y in arr_bool3:
zeros_and_ones[x, y] = confindencenumbers[count]##set so binary matrix knows where to plot
count=count+1
ax.imshow((zeros_and_ones), cmap=plt.cm.spectral_r, interpolation='none') ##Draw matrix
arr_bool3是座標和confindencenumbers是浮
列表