0

The confusion matrix is displaying data out of frame. I tried resizing the figure where the figure area is changing but the data is still out of frame. Any idea? Thanks in advance.

enter image description here

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)
PS Nayak
  • 409
  • 8
  • 20
  • 1
    This is a bug of matplotlib 3.1.1 [matplotlib/seaborn: first and last row cut in half of heatmap plot](https://stackoverflow.com/questions/56942670/matplotlib-seaborn-first-and-last-row-cut-in-half-of-heatmap-plot) – baccandr Nov 23 '19 at 07:56
  • See this answer for latest version that should work now: https://stackoverflow.com/questions/56942670/matplotlib-seaborn-first-and-last-row-cut-in-half-of-heatmap-plot/58924246#58924246 – JohanC Nov 23 '19 at 21:33

1 Answers1

0

This seems similar to this matplotlib/seaborn: first and last row cut in half of heatmap plot

What version of matplotlib are you using? Reverting to version 3.1.0 seemed to fix this issue.

fortymod
  • 43
  • 5
  • I'm using 3.1.2 as I used the command from Anaconda website. Then to revert, should I uninstall 3.1.2 and then reinstall 3.1.0? – PS Nayak Nov 23 '19 at 17:35