So in this example of Scatter Map (https://plotly.com/python/scatter-plots-on-maps/),
It shows:
fig = go.Figure(data=go.Scattergeo(
lon = df['long'],
lat = df['lat'],
text = df['text'],
mode = 'markers',
marker_color = df['cnt'],
))
I can use the columns to show different colors: marker_color = df['cnt']
I applied the same logic to my data, which my data looks something like this:
Address
postcode state country lat lon
0 2016 New South Wales Australia -33.892778 151.203901
1 2153 New South Wales Australia -33.758601 150.992887
2 4211 Queensland Australia -28.033052 153.279625
And my code is:
fig = go.Figure(data=go.Scattergeo(lon=address['lon'], lat=address['lat'],
mode='markers', marker_color=address['state']))
fig.update_layout(title='The Customer Locations')
fig.show()
And I get an error
ValueError:
Invalid element(s) received for the 'color' property of scattergeo.marker
Invalid elements include: ['New South Wales', 'New South Wales', 'Queensland', 'New South Wales', 'Victoria', 'New South Wales', 'New South Wales', 'New South Wales', 'Victoria', 'Queensland']
So if I change to marker_color='red'
then just the entire marker changes to red. What am I doing wrong here? Iβm so confusedβ¦
Thank you!!