How to avoid scientific notation when annotating a nautical chart of a cluster?

I have a dataframe that contains percentages. If I use seaborn to create a clusterplot then somehow the number is 100

displayed as 1+e01

.

Is there a way to avoid this?

I tried to round up the percentages before plotting them, but that doesn't affect the plot.

0


source to share


1 answer


Use fmt="d"

as in this example :

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")

      



enter image description here

fmt

is a parameter heatmap

, but additional clustermap

kwargs are passed to the main heatmap.

+2


source







All Articles