0

I have the following code that produces a plot with Streamlit.

fig, ax = plt.subplots(figsize=(5,5))
plt.pie(label)
st.sidebar.pyplot(fig)

I want to change the default background color of the plot which is white in my case. How can I do this?
Let me know if you need further information.

Morgvn
  • 3
  • 3

1 Answers1

0

You can change the color py matplotlib config in the pie chart, because streamlit only display the chart into the UI.

To change the background color, you can follow matplotlib.colors build in function in here and the SO answer here

bao.le
  • 146
  • 1
  • 4