Python 如何在海生热图上仅标注大于x的值

Python 如何在海生热图上仅标注大于x的值,python,annotations,seaborn,heatmap,pearson-correlation,Python,Annotations,Seaborn,Heatmap,Pearson Correlation,我不想在我的seaborn热图上只标注大于0.4的值 这是我的密码: sns.set(字体刻度=0.6) 这就是我得到的: 谢谢通过一个简单的循环解决了这个问题,该循环在象限上迭代,并且仅当值大于0.4时才设置注释: for t in ax.texts: if float(t.get_text())>=0.4: t.set_text(t.get_text()) #if the value is greater than 0.4 then I set the tex

我不想在我的seaborn热图上只标注大于0.4的值

这是我的密码:

sns.set(字体刻度=0.6)

这就是我得到的:


谢谢

通过一个简单的循环解决了这个问题,该循环在象限上迭代,并且仅当值大于0.4时才设置注释:

for t in ax.texts:
    if float(t.get_text())>=0.4:
        t.set_text(t.get_text()) #if the value is greater than 0.4 then I set the text 
    else:
        t.set_text("") # if not it sets an empty text

for t in ax.texts:
    if float(t.get_text())>=0.4:
        t.set_text(t.get_text()) #if the value is greater than 0.4 then I set the text 
    else:
        t.set_text("") # if not it sets an empty text