Get help from the marimo community

Updated 2 months ago

Plotly Scatter Map Not Rendering Correctly

At a glance

A community member is attempting to use a Plotly Scatter Map, but the chart is showing a blank screen. They followed the official Plotly tutorial, but the issue persists. Another community member provides a working example code, suggesting that the issue may be related to the default map renderer in the "marimo" library. The original poster thanks the community member for the solution, which helped them resolve the issue.

Useful resources
I am attempting to use a Plotly Scatter Map. When I render it, it shows a basic blank chart. I tried to follow the official Plotly tutorial and it does the same thing. I'll put a screenshot below shortly.
Attachment
image.png
M
A
M
4 comments
This is the code from the "Basic example with Plotly Express" https://plotly.com/python/tile-scatter-maps/
Thanks for reporting. I made an issue to track: https://github.com/marimo-team/marimo/issues/2337
For reference, this code below does work. I am not sure if marimo needs to provide a default map renderer.

Plain Text
import plotly.express as px

df = px.data.carshare()
+ fig = px.scatter_mapbox(
- fig = px.scatter_map(
    df,
    lat="centroid_lat",
    lon="centroid_lon",
    color="peak_hour",
    size="car_hours",
    color_continuous_scale=px.colors.cyclical.IceFire,
    size_max=15,
    zoom=10,
+    mapbox_style="carto-positron",
)
fig
Thank you, that got me around it!
Add a reply
Sign up and join the conversation on Discord