Hi all,
I’m trying to set the color of the lines based on values from a list.
Because my lines are made by points connected they are also placed as a list and separated by ‘none’ as shown in the example below:
latList = [-1.407788065999966, -1.407767729999932, 'none', -1.407064031999937, -1.407082752999941, -1.406829880999965, 'none', -1.286245225999949, -1.286227953999969, 'none']
lonList = [51.68445894500008, 51.68445831200006, 'none', 51.68407429800004, 51.68422757100007, 51.68424889600004, 'none', 51.68556368200007, 51.68555818300007, 'none']
values = [5, 7, 'none',12, 9, 21, 'none', 2, 22, 'none' ]
fig_map.add_trace(
go.Scattermapbox(
lat = latList,
lon = lonList,
mode = 'lines',
opacity= 1,
line = dict(
width = 1,
color = values,
),
)
)
I have also trying replacing the value for color names, but it doesn’t work either.
Thanks for the help!