How can we use Plotly's config parameter to edit the hoverbar/modebar?

According to the plotly docs: you can pass a config parameter to When I try to use it pops out into a new browser tab. Is there a way to utilize the config parameter to update the graphs that streamlit displays?

config = {
‘toImageButtonOptions’: {
‘format’: ‘svg’, # one of png, svg, jpeg, webp
‘filename’: ‘custom_image’,
‘height’: 500,
‘width’: 700,
‘scale’: 1 # Multiply title/legend/axis/canvas sizes by this factor

fig =[1, 2, 3], y=[1, 3, 1])

I think I figured it out. I used this and it seems to be working:

st.plotly_chart(fig, use_container_width=False, **{‘config’: config})


Thanks. This was helpful.

FYI, since you are unpacking the dictionary anyway, you can just write:

st.plotly_chart(fig, use_container_width=False, config=config)