g = sns.factorplot(x='x', y='y', hue='class', palette=graycolors, data=df,
    linestyles=['-', '--'], markers=['o', 'v'], legend=False)
g.axes[0][0].legend(loc=1)
Python Seaborn Matplotlib setting line style as legend