假设我们有以下热图。
是否可以使用Matplotlib、Seaborn或其他软件包以如下等距对齐方式呈现。
使用代码构建
import string
import numpy as np
from matplotlib import pyplot as plt
label=list(string.ascii_uppercase)
mdata = np.random.randn(3, len(label), len(label))
data = mdata[0, :, :]
data=np.tril(data,-1)
fig, ax = plt.subplots()
heatmap = ax.pcolor(data, cmap=plt.cm.Blues)
plt.show()
是否可以使用Matplotlib、Seaborn或其他软件包以如下等距对齐方式呈现。
triu_indices
更改为np.indices((N, N))
,但是没有成功。请给予建议。 - mpx