St.plotly_chart background don't resize even using use_container_width=true

Hey there.

As the title says, for example, I have a plotly fig, which I display with

st.plotly_chart(fig_1, use_container_width=True)

How I add the image to the chart:

plotly_logo = base64.b64encode(open(path_logo_white, "rb").read())
    
fig.update_layout(images=[dict(source="data:image/png;base64,{}".format(plotly_logo.decode()), xref="paper",
                                   yref="paper", x=0.05, y=1, sizex=2.5, sizey=1, xanchor="left", yanchor="top",
                                   opacity=0.05, layer="above")],
                      legend=dict(traceorder="reversed", title="", bgcolor="rgba(0,0,0,0)"))

And it works to see the image behind the chart.

But the image does not resize with the chart is there a work around? Thank you.

Hi @Marco1

Would you like to use st.image to display and resize the image? If using data viz libraries, you may have to fiddle with the data type (image object vs numerical representation of the image) and its display.