我N乘N熱圖使用以下代碼創建的,例如設n是10:單行(或列)在python熱圖
random_matrix = np.random.rand(10,10)
number = 10
incrmnt = 1.0
x = list(range(1,number +1))
plt.pcolormesh(x, x, random_matrix)
plt.colorbar()
plt.xlim(1, number)
plt.xlabel('Number 1')
plt.ylim(1, number)
plt.ylabel('Number 2')
plt.tick_params(
axis = 'both',
which = 'both',
bottom = 'off',
top = 'off',
labelbottom = 'off',
right = 'off',
left = 'off',
labelleft = 'off')
我想,可以添加2排熱圖一個靠近每個x軸和y軸,從row1 = np.random.rand(1,10)
和col1 = np.random.rand(1,10)
。 這裏是我想生產什麼的示例圖像:
在此先感謝。
還有一個非常[類似的問題(http://stackoverflow.com/questions/43073971/control-individual-linewidths-in-seaborn-heatmap)詢問如何「砍「不同地點的熱圖,以防某人感興趣。 – ImportanceOfBeingErnest