Seaborn热图unicode轴值

时间:2018-06-18 15:42:25

标签: python matplotlib seaborn

我正在尝试绘制热图。

Sample of heatmap

x轴上的值应该是像áéíóúý这样的unicode,依此类推,但我只能绘制一些信息。知道如何将值更改为unicode吗?

代码示例

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np

df_cm = pd.DataFrame(cm_norm, index = [num_to_char(i) for i in np.sort(alphabet)],
                    columns = [num_to_char(i) for i in np.sort(alphabet)])

sns.heatmap(df_cm, annot=True, annot_kws={"size": 8}, cmap=plt.cm.Blues, square=0.5)

0 个答案:

没有答案