-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: annotation coords are not floats #24643
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
Conversation
lib/matplotlib/offsetbox.py
Outdated
@@ -1243,12 +1243,12 @@ def __init__(self, offsetbox, xy, | |||
is determined by *boxcoords*. | |||
|
|||
xycoords : str or `.Artist` or `.Transform` or callable or \ | |||
(float, float), default: 'data' | |||
2-element tuple of these, default: 'data' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused since the default is a string and not a 2 element tuple- is this because we don't need to pass in a 2-tuple when the coordinate system is the same?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, exactly. See the AnnotationBBox demo, where some use a single string and some use two.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't catch that this was a line continuation but I'm finding the 'these' so ambiguous that I'm I think extra confused so what about being annoyingly explicit, something like 'scaler or 2 element tuple of str, Artist, callable, or transform : default 'data' "
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
xycoords : single or two-tuple of str, `.Artist`, `.Transform` or callable.
23c33f2
to
97e2184
Compare
…643-on-v3.6.x Backport PR #24643 on branch v3.6.x (DOC: annotation coords are not floats)
PR Summary
There may be a better way to phrase than what I have done here, but I'm pretty sure
(float, float)
is wrong. The more detailed description forxycoords
within the Annotation docstring states that it can bePR Checklist
Documentation and Tests
pytest
passes)Release Notes
.. versionadded::
directive in the docstring and documented indoc/users/next_whats_new/
.. versionchanged::
directive in the docstring and documented indoc/api/next_api_changes/
next_whats_new/README.rst
ornext_api_changes/README.rst