根据价值编辑海底热图注释

时间:2020-06-04 13:36:52

标签: python-3.x matplotlib seaborn

下面是seaborn的热图;

ax = sns.heatmap(df_heatmap, annot = True, cmap=cmap1, linewidths = 5, cbar = False, fmt=".3%", 
annot_kws = {"size": 12}, square = True)

现在,我想将注释设置为小数点后一位。我可以通过fmt = ".1%"来执行此操作,但是这会将许多注释设置为0.0%(如果它们小于0.05%)。这样看来,给定结果不存在这种情况,但是确实存在。有什么方法可以编辑注释,使其包含类似“ <0.1%”而不是0.0%的内容?

enter image description here

0 个答案:

没有答案