# New plotly.express scatter\_map not working

**URL:** <https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232>\
**Category:** 📊 Plotly Python\
**Created:** [September 11, 2024, 7:44pm UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232 "2024-09-11T19:44:35Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![analytic](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@analytic](https://community.plotly.com/u/analytic)\
**Post date:** [September 11, 2024, 7:44pm UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/1 "2024-09-11T19:44:35Z")

</div>

Afterreading the recent announcement about the transition from mapbox to map functions for tiled maps in Plotly 5.24.0, I tried to run a simple example from the documentation but just got an empty set of axes. Same story for scatter\_map, line\_map, choropleth\_map and density\_map - all empty. The equivalent Mapbox functions worked normally.

I also tried the new go.scattermap trace and its works fine.

Here’s the example:

```auto
import plotly.express as px

df = px.data.carshare()
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)
fig.show()

```

This runs without errors but just produces an empty plot

 ![Screenshot 2024-09-11 at 20.27.08](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/2/1/211634de6e01033046e5c622074fa99a335e8db0.jpeg)

---

<div class="post-metadata">

**Author:** ![adamschroeder](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/adamschroeder/32/17280_2.png) [@adamschroeder](https://community.plotly.com/u/adamschroeder)\
**Post date:** [September 11, 2024, 8:30pm UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/2 "2024-09-11T20:30:05Z")

</div>

Hi @analytic  
Are you using VS Code?

---

<div class="post-metadata">

**Author:** ![analytic](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@analytic](https://community.plotly.com/u/analytic)\
**Post date:** [September 12, 2024, 7:28am UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/3 "2024-09-12T07:28:28Z")

</div>

Hi Adam,

Yes I am using VS Code (on macOS if that helps)

Best regards,  
David

---

<div class="post-metadata">

**Author:** ![analytic](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@analytic](https://community.plotly.com/u/analytic)\
**Post date:** [September 12, 2024, 9:01am UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/4 "2024-09-12T09:01:17Z")

</div>

With a bit more testing I see that it’s the “vscode” renderer that is the problem.

None of the new “map” traces or plotly express figures work with the “vscode” renderer, but it I switch to “notebook” then everything works.

---

<div class="post-metadata">

**Author:** ![analytic](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@analytic](https://community.plotly.com/u/analytic)\
**Post date:** [September 12, 2024, 9:52am UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/5 "2024-09-12T09:52:11Z")

</div>

I have submitted a bug report against the VSCode Jupyter Notebook Renderer extension [https://github.com/microsoft/vscode-notebook-renderers/issues/213](https://github.com/microsoft/vscode-notebook-renderers/issues/213)  
Could it be that they are not up to date on the required plotly.js version? Not sure how to check that.

---

<div class="post-metadata">

**Author:** ![adamschroeder](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/adamschroeder/32/17280_2.png) [@adamschroeder](https://community.plotly.com/u/adamschroeder)\
**Post date:** [September 12, 2024, 12:50pm UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/6 "2024-09-12T12:50:16Z")

</div>

Exactly. VS Code uses its own version of Plotly.js, which means that the latest features rarely work immediately.

> **[Troubleshooting](https://plotly.com/python/troubleshooting/#vscode-notebook-nteract-and-streamlit-problems)**
>
> How

---

<div class="post-metadata">

**Author:** ![richardedwardhughes](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@richardedwardhughes](https://community.plotly.com/u/richardedwardhughes)\
**Post date:** [September 20, 2024, 11:03am UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/7 "2024-09-20T11:03:16Z")

</div>

I was having the same problem. I just modified fig.show() to:

> fig.show(renderer=‘notebook’)

and then it worked fine!

So your exact example, modify the renderer:

```auto
import plotly.express as px
df = px.data.carshare()
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)
fig.show(renderer='notebook')

```

Yields:

 ![Screenshot 2024-09-20 at 7.02.23 AM](https://us1.discourse-cdn.com/flex024/uploads/plot/original/3X/d/b/db44edde61aef17722cb37ed958412cb1db7dffc.png)

---

<div class="post-metadata">

**Author:** ![deepa-shalini](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/deepa-shalini/32/33066_2.png) [@deepa-shalini](https://community.plotly.com/u/deepa-shalini)\
**Post date:** [October 12, 2024, 5:50pm UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/8 "2024-10-12T17:50:53Z")

</div>

I have installed the latest version of vscode-python, and I don’t use Jupyter within VSCode.  
When I run the example code for px.scatter\_map, I don’t see anything in the browser. It just keeps loading and then nothing happens.

---

<div class="post-metadata">

**Author:** ![jsulopzs](https://avatars.discourse-cdn.com/v4/letter/j/57b2e6/32.png) [@jsulopzs](https://community.plotly.com/u/jsulopzs)\
**Post date:** [October 12, 2024, 5:53pm UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/9 "2024-10-12T17:53:15Z")

</div>

You can make it work in VSCode by using `fig.show(renderer="notebook")` as @richardedwardhughes pointed out.

```python

import plotly.express as px
df = px.data.carshare()
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)
fig.show(renderer='notebook')

```

---

<div class="post-metadata">

**Author:** ![deepa-shalini](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/deepa-shalini/32/33066_2.png) [@deepa-shalini](https://community.plotly.com/u/deepa-shalini)\
**Post date:** [October 12, 2024, 5:57pm UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/10 "2024-10-12T17:57:14Z")

</div>

Isn’t that only if you use Jupyter notebooks within VSCode. I DON’T use it. I use the plain VS Code editor.

---

<div class="post-metadata">

**Author:** ![deepa-shalini](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/deepa-shalini/32/33066_2.png) [@deepa-shalini](https://community.plotly.com/u/deepa-shalini)\
**Post date:** [October 12, 2024, 6:11pm UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/11 "2024-10-12T18:11:18Z")

</div>

Looks like it is not working from any editor. Maybe some other issue persists.

---

<div class="post-metadata">

**Author:** ![analytic](https://avatars.discourse-cdn.com/v4/letter/a/e0b2c6/32.png) [@analytic](https://community.plotly.com/u/analytic)\
**Post date:** [October 13, 2024, 10:58am UTC](https://community.plotly.com/t/new-plotly-express-scatter-map-not-working/87232/12 "2024-10-13T10:58:01Z")

</div>

I think Microsoft have now made the change to move to a later version of plotly.js that resolves this.  
As to when this change will appear in the released vscode renderer - I don’t know.

See this issue [https://github.com/microsoft/vscode-jupyter/issues/16037](https://github.com/microsoft/vscode-jupyter/issues/16037) and links therein.
