Florian Krause Florian Krause - 1 year ago 461
Python Question

How to move the legend in Seaborn FacetGrid outside of the plot?

I have the following code:

g = sns.FacetGrid(df, row="Type", hue="Name", size=3, aspect=3)
g = g.map(sns.plt.plot, "Volume", "Index")

This results in the following plot:

enter image description here

How can I move the legend outside of the plot?

Answer Source

According to mwaskom's comment above, this is a bug in OS X. Indeed switching to another backend solves the issue.

For instance, I put this into my matplotlibrc:

backend : TkAgg   # use Tk with antigrain (agg) rendering
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download