seaborn legend out code example
Example: sns legend outside
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.tsplot(data=gammas, time="timepoint", unit="subject",
condition="ROI", value="BOLD signal")
# Put the legend out of the figure
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)