mrbean
mrbean

Reputation: 191

How to change the position of text in seaborn jointplot

I get a jointplot as following using sns.jointplot with kind="kde".

figure

and I want to move the text to the left corner, what should I do here? Thanks

Upvotes: 1

Views: 1434

Answers (1)

ImportanceOfBeingErnest
ImportanceOfBeingErnest

Reputation: 339300

You may change the location of the legend via the _set_loc() method. Possible locations are numbers from 0 to 10, which denote the edges of the axes.

g = sns.jointplot(...)
g.ax_joint.get_legend()._set_loc(4)

E.g. loc=4 is the lower right corner. The upper left corner would be loc=2

loc parameter [Image taken from this answer]

Upvotes: 2

Related Questions