plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Documentation around Scattermap Markers is out of date and confusing

Open ronand97 opened this issue 8 months ago • 4 comments

Intent I want to add markers with different symbols to my plotly graph object Scattermap.

What I've tried

  • Naming symbols with square, circle, diamond etc. This works but color is not supported for these basic objects apart from circle.
  • Maki symbols

Issues

  • The documentation refers to maki symbols: https://plotly.com/python-api-reference/generated/plotly.graph_objects.Scattermap.html#plotly.graph_objects.scattermap.Marker.symbol but the link is broken. I found a separate reference to maki icons here - https://iconduck.com/sets/mapbox-maki-icons but can't get any of them to plot (have tried setting mode="markers", prefixing the symbol name with "maki-" and so on).

  • Plotly deprecated mapbox maps, which maki symbols depend on, and have moved to maplibre (https://plotly.com/python/mapbox-to-maplibre/). However there is no updated documentation on how to use marker symbols in plotly with a maplibre backdrop.

  • Other issues about this from 5-6 years ago are open referencing issues with symbol rendering on mapbox maps and suggesting fixes such as creating a mapbox account; generating public API keys; and only using supported themes. However these fixes do not apply to maplibre. (https://github.com/plotly/plotly.py/issues/1804; https://github.com/plotly/plotly.py/issues/2954)

Suggested Fix Update the documentation to show:

  1. How to add symbols to a graph_objects.Scattermap figure using out-of-the-box symbols
  2. How to add custom symbols to a graph_objects.Scattermap figure

ronand97 avatar Apr 28 '25 09:04 ronand97

thanks for the report @ronand97 - @LiamConnors please have a look.

gvwilson avatar Apr 30 '25 12:04 gvwilson

Thanks @ronand97 for the report.

Working on correcting the incorrect link now.

For the symbols not working, are there specific ones you tried that didn't work?

We have this example here https://plotly.com/python/tile-scatter-maps/#set-marker-symbols for setting marker symbols. Do those symbols render for you?

LiamConnors avatar Apr 30 '25 14:04 LiamConnors

Thanks @ronand97 for the report.

Working on correcting the incorrect link now.

For the symbols not working, are there specific ones you tried that didn't work?

We have this example here https://plotly.com/python/tile-scatter-maps/#set-marker-symbols for setting marker symbols. Do those symbols render for you?

Hey Liam thanks for taking a look. I can plot those three specific ones yeah. I just went back to test the maki icons. Initially I thought I couldn't get any of the maki icons working but trying again I got the very first one on this page (https://labs.mapbox.com/maki-icons/) working - the icon called aerialway. However when I try to plot charging-station it doesn't work. So it seems like only some of the maki icons are supported, maybe this was clearer on the old link which now doesn't work.

Separately a small note on the documentation you linked me (https://plotly.com/python/tile-scatter-maps/#set-marker-symbols) - it took me a second to realise that the bullet points were map styles and seemingly not related to symbols. I would expect that to be a list of supported symbols, whereas you can only see 3 supported symbols (bus, airport, harbor) by reading the code and it's not so clear what other icons are supported.

ronand97 avatar Apr 30 '25 15:04 ronand97

Thanks @ronand97. Good point about the bullet list. I'll rework this section. And will try out these other symbols to see what's working for me.

LiamConnors avatar Apr 30 '25 15:04 LiamConnors

Hi @ronand97, sorry for the delay in getting you an answer on this.

The reason some markers don't work is the version of Maki icons we are using is v2.1 (https://app.unpkg.com/[email protected]/files/icons) and https://labs.mapbox.com/maki-icons/ is referring to the latest version (v8).

We are going to update Plotly.js to use the latest: https://github.com/plotly/plotly.js/issues/7447 describes the issue in more detail.

And I'll update the docs to ensure we outline which icons will work based on the version of Maki used.

Thanks for opening this issue.

LiamConnors avatar Jun 25 '25 19:06 LiamConnors

Hi @ronand97, sorry for the delay in getting you an answer on this.

The reason some markers don't work is the version of Maki icons we are using is v2.1 (https://app.unpkg.com/[email protected]/files/icons) and https://labs.mapbox.com/maki-icons/ is referring to the latest version (v8).

We are going to update Plotly.js to use the latest: plotly/plotly.js#7447 describes the issue in more detail.

And I'll update the docs to ensure we outline which icons will work based on the version of Maki used.

Thanks for opening this issue.

Thanks Liam, makes sense. Appreciate the update and coming back to this!

ronand97 avatar Jun 26 '25 08:06 ronand97

Hey @LiamConnors, any update on this? I find myself needing some marker functionality again and I'd left a link to this issue as a comment in my codebase which reminded me about it 😄

ronand97 avatar Sep 05 '25 10:09 ronand97

Thanks for the reminder @ronand97. I'll take a look at this next week

LiamConnors avatar Sep 05 '25 14:09 LiamConnors