Indeed, seaborn
doesn't handle legends well so far. You can use plt.legend()
to control legend properties directly through matplotlib
, in accordance with Matplotlib Legend Guide.
Note that in Seaborn 0.10.0 tsplot
was removed, and you may replicate (with different values for the estimation if you please) the plots with lineplot
instead of tsplot
.
Snippet
import matplotlib.pyplot as plt
import seaborn as sns
sns.set(style="darkgrid")
# Load the long-form example gammas dataset
gammas = sns.load_dataset("gammas")
# Plot the response with standard error
sns.lineplot(data=gammas, x="timepoint", y="BOLD signal", hue="ROI")
# Put the legend out of the figure
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
Output
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…