In [5]:
import numpy
import pandas
from matplotlib import pyplot
import seaborn
%matplotlib inline
seaborn.set(style='ticks')
N = 6
Names = ['A', 'B', 'C', 'D']
df = pandas.DataFrame({
'Year': [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2016],
'Ranking': [1, 4, 2, 3, 4, 2, 3, 10],
'Player': ['A','B','C', 'D','B','C', 'D', 'A']
})
df
fg = seaborn.FacetGrid(data=df, hue='Player', hue_order= Names, aspect=1.61, size=3)
fg.map(pyplot.scatter, 'Year','Ranking').add_legend()
fg.fig.axes[0].invert_yaxis()
In [6]:
df
Out[6]: