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
enable changing the color of marker icons in a ScatterMapBox plot #6599
<head>
<!-- Load plotly.js into the DOM -->
<script src='https://cdn.plot.ly/plotly-2.20.0.min.js'></script>
</head>
<body>
<div id='myDiv'><!-- Plotly chart will be drawn inside this DIV --></div>
<script>
var data = [
{
type: "scattermapbox",
mode: "markers+text+lines",
lon: [-75, -80, -50],
lat: [45, 20, -20],
color:'red',
marker: { size: 20, symbol: 'bus' },
text: 'bus',
textposition: "bottom right"
}
];
var layout = {
mapbox: { style: "outdoors", zoom: 0.7 },
showlegend: false, height: 500, width: 700
};
var config = {mapboxAccessToken: mytoken};
Plotly.newPlot("myDiv", data, layout, config);
</script>
</body>
I tried to change the color of the MAKI icons by trying to specify it inside marker dict but it does not work. However, changing the style of mapbox in the layout changes the color of the icons. So it should be possible to specify the color in the marker too (without changing the style). I could not find any information about this in the documentation.
changed the title [-]Changing the color of marker icons in a ScatterMapBox plot[/-][+]enable changing the color of marker icons in a ScatterMapBox plot[/+]on Aug 9, 2024
Activity
Kully commentedon May 22, 2023
See here:
https://plotly.com/python/reference/scattermapbox/#scattermapbox-marker-symbol
serboba commentedon Jul 18, 2023
Yes, but this works only if the marker symbol is not a MAKI icon.
[-]Changing the color of marker icons in a ScatterMapBox plot[/-][+]enable changing the color of marker icons in a ScatterMapBox plot[/+]emilykl commentedon Aug 28, 2026
Fixed by #7825.