Mady
Mady2mo ago

Plotly Scatter Map Not Rendering Correctly

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.
No description
Solution:
For reference, this code below does work. I am not sure if marimo needs to provide a default map renderer. ```diff import plotly.express as px ...
Jump to solution
4 Replies
Mady
MadyOP2mo ago
This is the code from the "Basic example with Plotly Express" https://plotly.com/python/tile-scatter-maps/
Scatter
Over 11 examples of Scatter Plots on Tile Maps including changing color, size, log axes, and more in Python.
Akshay
Akshay2mo ago
Thanks for reporting. I made an issue to track: https://github.com/marimo-team/marimo/issues/2337
GitHub
px.scatter_map does not display · Issue #2337 · marimo-team/marimo
Describe the bug From Discord. "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...
Solution
Myles Scolnick
Myles Scolnick2mo ago
For reference, this code below does work. I am not sure if marimo needs to provide a default map renderer.
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
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
Mady
MadyOP2mo ago
Thank you, that got me around it!