I am plotting the following heatmap in seaborn. the dataframe is read from the foll. csv file: https://www.dropbox.com/s/mb3wc8mmis0m7g6/df_trans.csv?dl=0
ax = sns.heatmap(df, linewidths=.1, linecolor='gray', cmap=sns.cubehelix_palette(light=1, as_cmap=True))
locs, labels = plt.xticks()
plt.setp(labels, rotation=0)
locs, labels = plt.yticks()
plt.setp(labels, rotation=0)
How can I modify the colorbar numbers so that they 160000 shows up as 1.6 with a 10^5 on top of colorbar. I know hot to do this in matplotlib but not in seaborn:
import matplotlib.ticker as tkr
formatter = tkr.ScalarFormatter(useMathText=True)
formatter.set_scientific(True)
ax.yaxis.set_major_formatter(formatter)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…