I'm using factorplot(kind="bar")
with seaborn.
The plot is fine except the legend is misplaced: too much to the right, text goes out of the plot's shaded area.
How do I make seaborn place the legend somewhere else, such as in top-left instead of middle-right?
Check out the docs here: https://matplotlib.org/users/legend_guide.html#legend-location
adding this simply worked to bring legend out of the plot:
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
This is how I was able to move the legend to a particular place inside the plot and change the aspect and size of the plot:
This worked for me to change the size and aspect of the plot as well as move the legend outside the plot area.
I figured this out from mwaskom's answer here and Fernando Hernandez's answer here.
Modifying the example from http://web.stanford.edu/~mwaskom/software/seaborn/examples/factorplot_bars.html
You can use
legend_out = False
Building on @user308827's answer: you can use
legend=False
in factorplot and specify the legend through matplotlib: