seaborn clustermap 中的自定义 yticks

问题描述

我的数据框如下所示:

import pandas as pd
    d={'a':[1,2,3,4,5],'b':[6,7,8,9,10],'c':[11,12,13,14,15],'d':[16,17,18,19,20],'e': ['a','a','c','d'],'f':['a','b',]}
    
    df = pd.DataFrame(d)

我在 Orange 中绘制了一个集群图并得到了这个:

enter image description here

因为我知道 Orange 基于 Python,所以我想知道如何使用 sns.clustermap 来做到这一点?

如何获取自定义 yticks,以显示 f 列的相应值?我只设法将 e 列绘制为色标。

e = df.e
lut = dict(zip(e.unique(),"rbg"))
row_colors = e.map(lut)
sns.clustermap(df.iloc[:,:-2],row_colors=row_colors)

enter image description here

重新表述:如何用 f 列中的值替换 y-ticks(0,1,3)?

任何想法将不胜感激。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...