Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use annotate on JointGrid #2306

Closed
ironerumi opened this issue Sep 30, 2020 · 2 comments
Closed

Cannot use annotate on JointGrid #2306

ironerumi opened this issue Sep 30, 2020 · 2 comments

Comments

@ironerumi
Copy link

Hi, it is kind of related to #1873, I'm using seaborn 0.11.0, when I trying to annotate,

j = sns.jointplot(feat_1, feat_2, data=X_train, kind="kde", color="r", space=0)
j.annotate(stats.pearsonr,frameon=False)

the following error occurred

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-25-52199c4ff320> in <module>
      5 j = sns.jointplot(feat_1, feat_2, data=X_train,
      6                       kind="kde", color="r", space=0)
----> 7 j.annotate(stats.pearsonr,frameon=False)
      8 
      9 graph.x = X_train[feat_1]

AttributeError: 'JointGrid' object has no attribute 'annotate'

Is there an alternative to add annotations to JointGrid?
Many thanks!

@mwaskom
Copy link
Owner

mwaskom commented Sep 30, 2020

Indeed, that method was deprecated (in 0.9) and removed (in 0.11).

You can add arbitrary text to matplotlib figures; use JointGrid.ax_joint.text to do so.

@mwaskom mwaskom closed this as completed Sep 30, 2020
@seralouk
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants