title: Getting attribute error : module 'matplotlib.pyplot' has no attribute 'canvas'
body: <pre><code>    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></pre>
  
  <p>Code in HTML file to fetch the image :</p>
  
  <pre><code>    &lt;div id="fig_container"&gt;
      {{ div_figure|safe }}
  &lt;/div&gt;
  </code></pre>
  
  <p>Using latest versions of <code>Python</code> and <code>Django</code>. On executing the attribute error is displayed</p>
  
  <blockquote>
    <p>module 'matplotlib.pyplot' has no attribute 'canvas'</p>
  </blockquote>
  
  <p>I am new to it and unable to resolve the error. Please help!!!</p>