Trying to use the st.plotly_chart() but don't change the Theme

Summary

Hello, I’am trying to use the st.plotly_chart() but the theme is always default from plotly, don’t change to streamlit theme as the update from december 2022.

Steps to reproduce

Code snippet:

fig = px.histogram(filter_students_sum_year_month, x=filter_students_sum_year_month.index,
                   y=filter_students_sum_year_month.columns,
                   barmode='group',
                   text_auto='.2s',
                    )

st.plotly_chart(fig, theme="streamlit", use_container_width=True)

If applicable, please provide the steps we should take to reproduce the error or specified behavior.

Expected behavior:
Create a dataframe with multiples columns with int number and create a grouped bar chart
Explain what you expect to happen when you run the code above.

Actual behavior:
Only plot the default plotly theme, dont change to streamlit theme

Debug info

  • Streamlit version 1.11.1
  • Python version: Python 3.9.13
  • Using Conda? PipEnv? PyEnv? Pex?
  • OS version: win 11
  • Browser version: Chrome

Requirements file

Using Windows 11, vs code, pip env, 3.9.13 venv
Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.

Links

Hi @Jrneliodias ,

have you updated your streamlit version?

pip install streamlit --upgrade if you use pip like me.

How do I upgrade to the latest version of Streamlit? - Streamlit Docs otherwise!

1 Like

@willhuang thanks. That’s work well.