fig = go.Figure(data=[go.Pie(labels=count.index.tolist(), values=count.values)]) fig.write_image(fig, \'fig1.png\') st.plotly_chart(fig)