Skip to content

Commit c40e749

Browse files
jvddjonasvdd
andauthored
fix: add colors to streamlit example 🎨 (#187)
* 🎨 add colors to streamlit example * 📝 review --------- Co-authored-by: Jonas Van Der Donckt <[email protected]>
1 parent 40555e4 commit c40e749

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

examples/other_apps/streamlit_app.py

+9
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,19 @@
99
To run this example execute the following command:
1010
$ streamlit run streamlit_app.py
1111
12+
Note: to have colored traces in the streamlit app, you should always include the
13+
following code: `import plotly.io as pio; pio.templates.default = "plotly"`
14+
1215
"""
1316

1417
__author__ = "Jeroen Van Der Donckt"
1518

19+
# Explicitely set pio.templates in order to have colored traces in the streamlit app!
20+
# -> https://discuss.streamlit.io/t/streamlit-overrides-colours-of-plotly-chart/34943/5
21+
import plotly.io as pio
22+
23+
pio.templates.default = "plotly"
24+
1625
# 0. Create a noisy sine wave
1726
import numpy as np
1827
import plotly.graph_objects as go

0 commit comments

Comments
 (0)