Similar to seaborn's hue function in plotly

Hi @Zakk,

Here’s that pandas groupby approach I was referring to:

for region, geo_region in geo.groupby('Geographical region'):
    fig.add_scatter(x=geo_region.Year, y=geo_region.Number, name=region, mode='lines')

And here’s the complete code block:

import plotly.graph_objs as go
import pandas as pd
from plotly.offline import iplot, init_notebook_mode
init_notebook_mode()

geo = pd.read_csv('my_output')

fig = go.Figure()
for region, geo_region in geo.groupby('Geographical region'):
    fig.add_scatter(x=geo_region.Year, y=geo_region.Number, name=region, mode='lines')

iplot(fig)

Note that in the live version the legend has a scroll bar, that’s why not all of the regions show up in this static image. If you need all of the regions to show up statically, then just increase the layout.height property of the figure.

Hope that helps!
-Jon