You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug(?)] Markers not showing when changing symbol in Scattermapbox #891
I was trying to do a Scattermapbox with different marker symbols, and they didn't render, at first I thought it was a Dash problem, but then I reproduce the same problem without dash (just plotly).
You can find some code to reproduce the error in the following link:
I am not trying to set color and size but still the custom markers do not render when I select something else than the default, for example "diamond". Can we re-open this issue?
Reacted by Isaac V, Gautham Kumaran, Dan McCabe, LuisScoccola, emXXina and Peter Dieter
I have same problem in R. I have a shiny app w/ mapbox, and a choropleth. When I add markers, I get discrete colors just fine, but two things I can't do:
Not related to this issue: I can't get continuous color scale
I know this is over two years later, but I had the same issue recently and found my solution. You have the wrong mapbox style selected. The mapbox symbols do not work with the "carto-positron" style or "open-street-map".
In order for symbols to work, you need to use the following mapbox styles (in addition to having a free Mapbox account with a public key):
I know this is over two years later, but I had the same issue recently and found my solution. You have the wrong mapbox style selected. The mapbox symbols do not work with the "carto-positron" style or "open-street-map".
In order for symbols to work, you need to use the following mapbox styles (in addition to having a free Mapbox account with a public key):
I'm working on this project anymore but I can forward the solution if there is one. @Sajjad-Mahmoudi No luck, eh? Did you try every one of those options?
I'm working on this project anymore but I can forward the solution if there is one. @Sajjad-Mahmoudi No luck, eh? Did you try every one of those options? @joeflack4
Hi, below is the code snippet:
px.set_mapbox_access_token(my_token)
fig = px.scatter_mapbox(data_frame=dff_exploded,
lat="lat", lon="lon",
zoom=6,
mapbox_style="outdoors", # "basic", "outdoors", "satellite-streets", "light"
# hover_name="facilities" + ": " + "n_trials",
width=1500,
height=700,
hover_data={'lat': False, 'lon': False, 'facilities': True, 'n_trials': True},
)
fig.update_traces(cluster=dict(enabled=True,
maxzoom=12,
color='#FF3333',
size=15,
opacity=1,
),
marker=dict(opacity=1,
symbol='circle', # marker
size=10,
color='blue',
),
hovertemplate="%{customdata[2]}: %{customdata[3]}"
)
So, I tried all the recommended solutions to change the marker from "circle" to "marker" and some others, but only "circle" marker is overlayed on the map.
Try removing the mapbox info from the original px.scatter_mapbox call. Also be sure the map_box style works with different symbols. Not all do. Also, not all of the symbols are currently working. I know "streets" and "triangle" work together, so I've included it below in an excerpt of my working code.
This issue is already closed, but I just wanted to leave a note that Maki symbols should work smoothly in plotly.py v7.0.0 and above. See this comment for more information.
Note that Mapbox traces have been replaced by Map traces. In most cases, replacing the word mapbox/Mapbox with map/Map everywhere it appears, and removing references to the Mapbox access token, should be all that's needed to migrate. See this docs page for details.
Activity
cldougl commentedon Dec 4, 2017
Hi there,
You can find more options about setting the marker for scattermapbox here: https://plot.ly/python/reference/#scattermapbox-marker
Note, this trace does not behave exactly like typical plotly.js scatter traces as it uses mapbox: https://www.mapbox.com/
HaraldHeitmann commentedon Dec 4, 2017
Thank you!
Just to clarify, the issue was that I was setting a color and a size, to a symbol which isn't a circle, so it wasn't working properly?
cldougl commentedon Dec 4, 2017
no problem, to help clarify:
https://plot.ly/python/reference/#scattermapbox-marker-symbol: Sets the marker symbol. Full list: https://www.mapbox.com/maki-icons/ Note that the array
marker.colorandmarker.sizeare only available for "circle" symbols.so the 2 issues you may be running into are:
a. color and size are only available when symbol is set to circle.
b. the typical "plotly" symbols, (ie: https://plot.ly/python/reference/#scatter-marker-symbol) are not available for this trace type, instead you can find options and further instructions at the mapbox link: https://www.mapbox.com/maki-icons/
andreapiso commentedon Oct 23, 2018
I am not trying to set color and size but still the custom markers do not render when I select something else than the default, for example "diamond". Can we re-open this issue?
joeflack4 commentedon May 20, 2021
Description
I have same problem in R. I have a shiny app w/ mapbox, and a choropleth. When I add markers, I get discrete colors just fine, but two things I can't do:
Code
W/ symbols off, markers appear
W/ symbols on, don't appear
Strangely, it looks like it's also trying to color the symbols even though I'm not asking it to do so.

dancassin commentedon Jul 6, 2023
I know this is over two years later, but I had the same issue recently and found my solution. You have the wrong mapbox style selected. The mapbox symbols do not work with the "carto-positron" style or "open-street-map".
In order for symbols to work, you need to use the following mapbox styles (in addition to having a free Mapbox account with a public key):
Reference
https://plotly.com/python/scattermapbox/#set-marker-symbols
Sajjad-Mahmoudi commentedon Aug 24, 2023
It doesn't work. Only circle is rendered.
joeflack4 commentedon Aug 25, 2023
I'm working on this project anymore but I can forward the solution if there is one.
@Sajjad-Mahmoudi No luck, eh? Did you try every one of those options?
Sajjad-Mahmoudi commentedon Aug 25, 2023
Hi, below is the code snippet:
px.set_mapbox_access_token(my_token)
fig = px.scatter_mapbox(data_frame=dff_exploded,
lat="lat", lon="lon",
zoom=6,
mapbox_style="outdoors", # "basic", "outdoors", "satellite-streets", "light"
# hover_name="facilities" + ": " + "n_trials",
width=1500,
height=700,
hover_data={'lat': False, 'lon': False, 'facilities': True, 'n_trials': True},
)
fig.update_traces(cluster=dict(enabled=True,
maxzoom=12,
color='#FF3333',
size=15,
opacity=1,
),
marker=dict(opacity=1,
symbol='circle', # marker
size=10,
color='blue',
),
hovertemplate="%{customdata[2]}: %{customdata[3]}"
)
So, I tried all the recommended solutions to change the marker from "circle" to "marker" and some others, but only "circle" marker is overlayed on the map.
dancassin commentedon Aug 25, 2023
Try removing the mapbox info from the original px.scatter_mapbox call. Also be sure the map_box style works with different symbols. Not all do. Also, not all of the symbols are currently working. I know "streets" and "triangle" work together, so I've included it below in an excerpt of my working code.
gaardhus commentedon May 28, 2024
I think raising a warning for the user when they specify both symbol and color attributes for their markers would be a nice addition in this case.
emilykl commentedon Aug 31, 2026
This issue is already closed, but I just wanted to leave a note that Maki symbols should work smoothly in plotly.py v7.0.0 and above. See this comment for more information.
Note that Mapbox traces have been replaced by Map traces. In most cases, replacing the word
mapbox/Mapboxwithmap/Mapeverywhere it appears, and removing references to the Mapbox access token, should be all that's needed to migrate. See this docs page for details.