【问题标题】:Data of image plot in matplotlib and seaborn out of frame [duplicate]matplotlib中的图像图数据和seaborn out of frame [重复]
【发布时间】: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)

【问题讨论】:

标签: python dataframe matplotlib seaborn heatmap


【解决方案1】:

这似乎类似于matplotlib/seaborn: first and last row cut in half of heatmap plot

你使用的是什么版本的 matplotlib?恢复到 3.1.0 版似乎可以解决此问题。

【讨论】:

  • 我使用的是 3.1.2,因为我使用了 Anaconda 网站上的命令。然后要恢复,我应该卸载3.1.2然后重新安装3.1.0吗?
猜你喜欢
  • 2017-09-29
  • 1970-01-01
  • 1970-01-01
  • 2020-05-11
  • 2021-04-21
  • 1970-01-01
  • 1970-01-01
  • 2021-10-13
  • 2021-10-14
相关资源
最近更新 更多