plt.figure(figsize=(8, 8))
sns.heatmap(conf_matrix, annot=True, fmt="d");
plt.title("Confusion matrix")
plt.ylabel('True class')
plt.xlabel('Predicted class')
html_fig = mpld3.fig_to_html(plt,template_type='general')
plt.close(plt)
Code in HTML file to fetch the image :
<div id="fig_container">
{{ div_figure|safe }}
</div>
Using latest versions of Python
and Django
. On executing the attribute error is displayed
module 'matplotlib.pyplot' has no attribute 'canvas'
I am new to it and unable to resolve the error. Please help!!!