I have been plotting location on a map using go.Scattermapbox. Everything works perfectly fine except the Scatter points are vanishing if I change their shape using ‘symbol’.
Weird fact, the change does appear in the legend but is not being plotted. I tried with different symbol (diamond, cross, etc…)
indent preformatted text by 4 spaces
data = go.Scattermapbox(
lon = df.LON,
lat = df.LAT,
mode = 'markers',
marker=dict(size=15,
color= 'red',
opacity = 0.7)
This piece of code does make all points appearing.
data = go.Scattermapbox(
lon = df.LON,
lat = df.LAT,
mode = 'markers',
marker=dict(size=15,
symbol = 'diamond'
color= 'red',
opacity = 0.7)
and is this one, the points are ‘disappearing’.
Many thanks for your time and reply guys !
PS : I tried on Jupyter Notebook + Dash App on local host. Both did not work.
The trouble you’re running into is that marker symbols for the scattermapbox trace work a bit differently than scatter traces because the marker rendering is actually performed by the Mapbox library. Here’s the docstring for the scattermapbox.marker.symbol property.
Sets the marker symbol. Full list: https://www.mapbox.com/maki-
icons/ Note that the array `marker.color` and `marker.size` are
only available for "circle" symbols.
If you visit https://www.mapbox.com/maki-icons/ you can hover over the icons to see the name of each symbol. The name you specify should include everything up until the hyphen. For example, if you hover over an air plain icon and the tooltip says that it’s called airfield-11.svg, you use 'airfield' as the symbol.
Thanks a lot for the explanation and the solution. I see how it will work. For the moment I moved to another part of the Dashboard but will update and provide the code when I will have changed it.
@jmmease - Is there an open case regarding the missing symbols? I’m trying to use “wheelchair”, which is part of the mapbox icons at https://labs.mapbox.com/maki-icons/, but this particular symbol is not working for me. Other symbols (e.g., bus, embassy) are working just fine though.
Related to the threat, I am trying to have a map with temperature on it. If I enlarge the temperature measurements to cover the area, the circles overlapping each other and do not look good:
I think the issue is whether the icons are included in the style you are using or not. For example, wheelchair doesn’t seem to be included in the default monochrome theme
Interesting. I noticed that the icons have different colors though. For example, “bus” is blue and “embassy” is brown. Does that mean that different icons have different themes/palettes? I think we need an official response from Plotly on this. I’ll try to bring it up once I have enterprise support.
I have a question. How I can put maki -icons in my scattermapbox in dash?
I’ve downloaded the library Maki Icons | By Mapbox but I don’t know what I have to do with the .zip.
(i’ve tried the same example in Dash Documentation: Scatter plots on mapbox in Python
But in the plot, I only see the lines, not the symbols:
I know this is over a year later, but I had the same issue and found my solution. You have the wrong mapbox style selected. The mapbox symbols do not work with the “carto-positron” style.
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):