矩阵时间序列绘图
Ref
如果设置日期可以参考
# Short_Corr 【T,K,K】
NumVariables = 10
fig, axes = plt.subplots(NumVariables, NumVariables)
for i in range(1, NumVariables):
for j in range(i):
if (i != NumVariables-1) & (j != 0):
axes[i][j].set_ylim([0, 1])
axes[i][j].yaxis.set_major_locator(plt.NullLocator())
axes[i][j].xaxis.set_major_locator(plt.NullLocator())
axes[i][j].plot(Short_Corr[:, i, j].tolist())
elif (i != NumVariables-1) & (j == 0):
axes[i][j].set_ylim([0, 1])
axes[i][j].plot(Short_Corr[:, i, j].tolist())
axes[i][j].xaxis.set_major_locator(plt.NullLocator())
elif (i == NumVariables-1) & (j == 0):
axes[i][j].set_ylim([0, 1])
axes[i][j].plot(Short_Corr[:, i, j].tolist())
elif (i == NumVariables-1) & (j != 0):
axes[i][j].set_ylim([0, 1])
axes[i][j].plot(Short_Corr[:, i, j].tolist())
axes[i][j].yaxis.set_major_locator(plt.NullLocator()) # x轴移除标签,保留刻度
for i in range(0, NumVariables):
for j in range(i, NumVariables):
if i == j:
plt.text(0.5, 0.5, s=f'{i}', transform=axes[i][i].transAxes, fontsize=18)
axes[i][j].yaxis.set_major_locator(plt.NullLocator())
axes[i][j].xaxis.set_major_locator(plt.NullLocator()) # x轴移除标签,刻度