【发布时间】:2020-03-19 04:36:46
【问题描述】:
混淆矩阵显示数据超出框架。我尝试调整图形区域正在更改但数据仍然超出框架的图形大小。任何想法?提前致谢。
cm = confusion_matrix(decoded_y_test, predictions)
cm_df = pd.DataFrame(cm,
index = ['HIT','AVERAGE','FLOP'],
columns = ['HIT','AVERAGE','FLOP'])
plt.figure(figsize=(5.5,4))
sns.heatmap(cm_df, annot=True)
【问题讨论】:
-
这是matplotlib 3.1.1的一个bug matplotlib/seaborn: first and last row cut in half of heatmap plot
-
查看这个答案以获得现在应该可以使用的最新版本:stackoverflow.com/questions/56942670/…
标签: python dataframe matplotlib seaborn heatmap