本文介绍了注释海洋簇图时如何避免科学计数法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含百分比的数据框.如果我使用seaborn制作了集群图,则数字100绘制为1+e01.

I have a dataframe that contains percentages. If I use seaborn to make a clusterplot somehow the number 100 is plotted as 1+e01.

有什么办法可以避免这种情况?

Is there any way to avoid this?

我尝试在绘制百分比之前将其四舍五入,但这并不影响绘图.

I tried rounding the percentages before plotting them, but that does not affect the plot.

推荐答案

使用fmt="d",如此示例:

import seaborn as sns
sns.set()

flights_long = sns.load_dataset("flights")
flights = flights_long.pivot("month", "year", "passengers")
flights = flights.reindex(flights_long.iloc[:12].month)

sns.heatmap(flights, annot=True, fmt="d")

fmtheatmap的参数,但其他clustermap kwargs传递到主热图.

fmt is a parameter to heatmap but additional clustermap kwargs are passed through to the main heatmap.

这篇关于注释海洋簇图时如何避免科学计数法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-13 12:43