Scattergeo.line with gradient color from origin to destination

Using code based on:

Need the lines drawn in flight_paths[] as gradient from point A to B, for example from red to green.
Cant figure it out. Help.

Hi @jrp,

Variable coloring within lines isn’t support in scattergeo traces. For completeness, it’s also not possible with 2D scatter or scattergl traces, but it is possible in 3D scatter3d traces.

So the best you could do would be a discrete gradient made up of multiple traces. If you go this route, for performance I’d recommend creating a single trace for each discrete color across all flights, where nan values separate individual flights. Feel free to post a simple example if you’re interested in working through this approach.