You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if we could pass arguments directly to ax.legend() from sns.scatterplot (and potentially many other Seaborn functions) using a parameter like legend_kws (or something similar).
I’m not sure if this has been considered already, but if adding this feature interests you, I’d be happy to work on it. I haven’t contributed to Seaborn before, but this seems like a relatively straightforward enhancement (or not?)—I just took a quick look at _ScatterPlotter.
The text was updated successfully, but these errors were encountered:
I've thought about adding this; it's not a bad idea.
But it's not something that could be added only to scatterplot. It would need to be added to any function in the sns namespace that produces a legend by default. I'm not sure how much work it will be to thread the kwargs dict down to the right place in all the relevant functions. Also you'd need to account for the fact that some functions do their own overriding of default legend kwargs, and that seaborn uses some hacks to achieve the "multi-variable legend" in the relational plotting functions. So it might be a lot of annoying work.
The sns.move_legend function should probably satisfy most or all usecases, although it's a little less obvious.
I hadn't thought of using sns.move_legend, but it does make sense to use it. It seems practical enough for what I had in mind. I'll let you close the issue.
Hi!
It would be great if we could pass arguments directly to
ax.legend()
fromsns.scatterplot
(and potentially many other Seaborn functions) using a parameter likelegend_kws
(or something similar).The idea would look like this:
I’m not sure if this has been considered already, but if adding this feature interests you, I’d be happy to work on it. I haven’t contributed to Seaborn before, but this seems like a relatively straightforward enhancement (or not?)—I just took a quick look at
_ScatterPlotter
.The text was updated successfully, but these errors were encountered: