Skip to content

Using color and symbol attributes for graph_objects.scattermapbox.Marker #2485

@lamipaul

Description

@lamipaul

Hi,
First of all thanks a lot for this amazing library !

I am encountering an issue when trying to set colors and symbols for scattermapbox Markers

Using the basic example provided here :
https://plotly.com/python/scattermapbox/

I just added a color attribute that is ignored if a symbol is specified.
When using multiple colors for multiple markers, adding a symbol attributes makes all the markers not appear.

Here is the reproductible example :

`
import plotly.graph_objects as go

mapbox_access_token = "pk.eyJ1IjoibGFtaXBhdWwiLCJhIjoiY2thY2Z6dWEwMWZxZjJ6bWtkc2N1YXR2eiJ9.lEZuHyjXzCw0Gll35MGqVg"

fig = go.Figure(go.Scattermapbox(
lat=['45.5017'],
lon=['-73.5673'],
mode='markers',
marker=go.scattermapbox.Marker(
size=14,
symbol='square',
color='rgb(255,0,0)'
),
text=['Montreal'],
))

fig.update_layout(
hovermode='closest',
mapbox=dict(
accesstoken=mapbox_access_token,
bearing=0,
center=go.layout.mapbox.Center(
lat=45,
lon=-73
),
pitch=0,
zoom=5
)
)

fig.show()
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions