这是我用过的代码。
%matplotlib inline import matplotlib.pyplot as plt import seaborn as sn plt.figure(figsize=(10,7)) sn.heatmap(cm, annot=True) plt.xlabel('Predicted') plt.ylabel('Truth')
我尝试更新 matplotlib 但更新后,同样的问题
import seaborn as sns glue = sns.load_dataset("glue").pivot(index="Model", columns="Task", values="Score") sns.heatmap(glue)
输出: