# Scattergeo.line with gradient color from origin to destination

**URL:** <https://community.plotly.com/t/scattergeo-line-with-gradient-color-from-origin-to-destination/20517>\
**Category:** 📊 Plotly Python\
**Created:** [March 6, 2019, 8:29am UTC](https://community.plotly.com/t/scattergeo-line-with-gradient-color-from-origin-to-destination/20517 "2019-03-06T08:29:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jrp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jrp/32/6798_2.png) [@jrp](https://community.plotly.com/u/jrp)\
**Post date:** [March 6, 2019, 8:29am UTC](https://community.plotly.com/t/scattergeo-line-with-gradient-color-from-origin-to-destination/20517/1 "2019-03-06T08:29:07Z")

</div>

Using code based on:

> **[Lines on Maps](https://plot.ly/python/lines-on-maps/)**
>
> How to draw lines, great circles, and contours on maps in Python.

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.

---

<div class="post-metadata">

**Author:** ![jmmease](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/jmmease/32/3706_2.png) [@jmmease](https://community.plotly.com/u/jmmease)\
**Post date:** [March 6, 2019, 10:49am UTC](https://community.plotly.com/t/scattergeo-line-with-gradient-color-from-origin-to-destination/20517/2 "2019-03-06T10:49:58Z")

</div>

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.

-Jon
