Plotly geoscatter figure width is not correct

I am trying to display a geoscatter plot on my webapp. I am using

 st.set_page_config(layout="wide")
st.plotly_chart(fig, use_containder_width = True)

Even with this settings my graph does not take up the entire page correctly.

When I update the width of my plot via

fig.update_layout(width = 1500)

This only seems to affect the padding of the figure

How can I solve this? Any guidance is much appreciated

The map projection forces the aspect ratio between the x-axis and the y-axis to be equal, so the minimum between the height and the width of the figure layout will control the overall size.

Short:

Tall:

Code:
import plotly.graph_objects as go
import streamlit as st

height = 600

st.title(f"Map with `{height = }`")

fig = go.Figure(go.Scattergeo())
fig.update_geos(projection_type="orthographic")
fig.update_layout(height=height, margin={"r": 0, "t": 0, "l": 0, "b": 0})

st.plotly_chart(fig, use_container_width=True)

st.divider()
"Some other content " * 10

Thanks mate appreciate your help

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.