Reputation: 22021
g = sns.factorplot(x="time", y="pulse", hue="kind", col="diet", data=exercise)
In seaborn, is there a way to plot the legend in the first sub-plot instead of second? This example is from here: https://seaborn.pydata.org/generated/seaborn.factorplot.html?highlight=factor#seaborn.factorplot
Upvotes: 2
Views: 1151
Reputation: 49022
There is an even easier way:
g = sns.factorplot(x="time", y="pulse", hue="kind", col="diet",
data=exercise, legend_out=False)
Upvotes: 1
Reputation: 11377
The following should work.
g = sns.factorplot(x="time", y="pulse", hue="kind",
col="diet", data=exercise, legend=False)
g.axes[0][0].legend()
PS:
Upvotes: 2