I want to make a multi-lines graph from a pandas dataframe on data that are in groups based on the values of a coloumn. The data here are from a api
import pandas as pd
import numpy as np
import calendar
import requests
import json
r = requests.get('http://data.unhcr.org/api/stats/mediterranean/monthly_arrivals_by_location.json')
js = r.json()
df = pd.DataFrame.from_records(js)
dfTop10 = df[['location','value']].\
groupby(['location']).sum().sort_values(['value'], ascending=[0])[1:5].reset_index()
grData = df[['year','month','location','value']].loc[df['location'].\
isin(dfTop10.location)].groupby(['location','year','month'])['value'].sum().reset_index()
grData['time'] = pd.to_datetime(df.year*10000+df.month*100+1,format='%Y%m%d')
grData= grData[['location','time','value']]
grData.groupby('location').plot()
This code produces 10 different plots while I want to be in the same image and the group to be shown as different colours. Can anyone help?