0

I wanted to plot a dataframe on an interactive map (openstreetmap) but the code I have is made to be points on the map and I would like to have "spots" like contour plotted on the map how can I change the code?

fig = px.scatter_mapbox(df, lat="lat", lon="lon", color="Hot Days", zoom=2.9, 
                       color_continuous_scale=px.colors.sequential.Hot_r,
                       mapbox_style='open-street-map',width=900,height=600)
fig.update_layout(title='Hot days until {}'.format(yesterday.strftime('%Y/%m/%d')))
fig.update_layout(
    mapbox=dict(
        center=go.layout.mapbox.Center(
            lat=47,
            lon=7
        )))

plot(fig, auto_open=True)

I have this: enter image description here

and I want this: enter image description here

userpython
  • 33
  • 5
  • You are getting points as you are plotting a scatter plot. Try one of the other types of maps listed [here](https://plotly.com/python/maps/) e.g. density or hexbin. – Tom B. May 31 '22 at 16:28
  • the density map is not quite what I want, this is a contour map, but I don't know if this is possible to do over a map with plotly – userpython May 31 '22 at 19:40

0 Answers0