I have the following code:
JavaScript
x
5
1
g = sns.FacetGrid(df, row="Type", hue="Name", size=3, aspect=3)
2
g = g.map(sns.plt.plot, "Volume", "Index")
3
g.add_legend()
4
sns.plt.show()
5
This results in the following plot:
How can I move the legend outside of the plot?
Advertisement
Answer
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
:
JavaScript
1
2
1
backend : TkAgg # use Tk with antigrain (agg) rendering
2