I want to add an image as a watermark on my plotly charts. Running the code below in a notebook works fine, but on Streamlit the image doesn’t show:
import plotly.graph_objects as go
fig = go.Figure()
fig.add_trace(go.Scatter(x=[0, 0.5, 1, 2, 19], y=[1.23, 2.5, 0.42, 3, 1]))
fig.add_layout_image(
dict(
source="https://i0.wp.com/scannerdabolsa.com.br/wp-content/uploads/2021/03/cropped-LOGO-SCANNER-DA-BOLSA.jpg",
xref="paper",
yref="paper",
x=0.5,
y=1,
sizex=0.5,
sizey=0.5,
#sizing="stretch",
opacity=0.5,
layer="below")
)
st.plotly_chart(fig, use_container_width=True)