title: AttributeError: 'Figure' object has no attribute savefig in Flask
body: <p>I am trying to display <code>plotly.express</code> bar chart in Flask. But it is giving <code>'Figure' object has no attribute savefig error</code>. The image gets displayed correctly while using <code>fig.show()</code>.</p>
  <pre><code>import matplotlib.pyplot as plt
  import plotly.express as px
  
  figs = px.bar(
      comp_df.head(10),
      x = &quot;Company&quot;,
      y = &quot;Staff&quot;,
      title= &quot;Top 10 departments&quot;,
      color_discrete_sequence=[&quot;blue&quot;],
      height=500,
      width=800
  )
  figs.savefig('static/images/staff_plot.png')
  #    fig.show()
  return render_template('plot.html', name='new_plot', url='static/images/staff_plot.png')
  </code></pre>
  <p>In <code>plot.html</code>, the image is displayed as below:</p>
  <pre><code>&lt;img src={{ url}} &gt;
  </code></pre>