簡體   English   中英

在 seaborn clutstermap 中旋轉 xticklabels

[英]Rotate xticklabels in seaborn clutstermap

我正在嘗試在 seaborn 集群 map 中旋轉我的 xticklabels,我已經嘗試過其他帖子的解決方案,但我永遠無法讓它工作。 這是我到目前為止所嘗試的:

hm=sns.clustermap(data=pltdf.iloc()[:,1:14],
              standard_scale=0,
               yticklabels=pltdf['uniprot_sym'])
hm.set_xticklabels(rotation=30)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-87-05bb29d461e2> in <module>
      2               standard_scale=0,
      3                yticklabels=pltdf['uniprot_sym'])
----> 4 hm.set_xticklabels(rotation=30)
      5 

AttributeError: 'ClusterGrid' object has no attribute 'set_xticklabels'

和這個

hm=sns.clustermap(data=pltdf.iloc()[:,1:14],
              standard_scale=0,
               yticklabels=pltdf['uniprot_sym'])
for ax in hm.axes.flat:
    ax.tick_params("x", labelrotation=45)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-86-d96774d92376> in <module>
      2               standard_scale=0,
      3                yticklabels=pltdf['uniprot_sym'])
----> 4 for ax in hm.axes.flat:
      5     ax.tick_params("x", labelrotation=45)

AttributeError: 'ClusterGrid' object has no attribute 'axes'

output這兩個在此處輸入圖像描述

hm=sns.clustermap(data=pltdf.iloc()[:,1:14],
                  standard_scale=0,
                  yticklabels=pltdf['uniprot_sym'])
plt.setp(hm.ax_heatmap.get_xticklabels(), rotation=30) 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM