所以我绘制了相关的聚类图,我发现了一些挫折,如果你们能帮我的话。你知道吗
import seaborn as sns
import matplotlib.pyplot as plt
import numpy as np
grafico_correlacao_renda_variavel_long_biased = sns.clustermap(correlacao_renda_variavel_long_biased, linewidths=.5,figsize=(40,40),annot= True,mask=mask,annot_kws={"size": 25})
plt.setp(grafico_correlacao_renda_variavel_long_biased.ax_heatmap.get_yticklabels(), rotation=0,fontsize=45)
plt.setp(grafico_correlacao_renda_variavel_long_biased.ax_heatmap.get_xticklabels(), rotation=90,fontsize=45)
grafico_correlacao_renda_variavel_long_biased.fig.suptitle('Renda Variável Long Biased',fontsize=100)
grafico_correlacao_renda_variavel_long_biased.savefig('teste.pdf')
plt.show()
那么我的问题是什么:
1)顶部和底部仅显示其大小的一半,我不知道如何修复它,我尝试缩小大小,但它没有做任何事情。你知道吗
2)虽然我希望地图是群集的,但我不希望地图外的线连接每个“单元”,有没有办法删除它?你知道吗
3)我只想显示对角线矩阵的下半部分,但当我应用遮罩时,它会在矩阵上给我几个空格
我的面具:面具=类np.zeros\u(correlacao\u renda\u variavel\u long\u biasted,数据类型)=np.布尔) 遮罩[np.triu\u索引\u来自(掩码)]=真
问题似乎是clustermap将掩码与数据一起排列。我的解决方案是运行clustermap两次:一次找出排列,以便创建一个掩码,这样一旦你将排列应用到它,你就可以恢复你真正想要的掩码。然后,用这个新掩码运行clustermap。即:
我希望这不会来得太晚。我也遇到了同样的问题,找到了你的问题。你知道吗
相关问题 更多 >
编程相关推荐