-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Improve documentation of text module #16004
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/text.py
Outdated
Draw the :class:`Annotation` object to the given *renderer*. | ||
""" | ||
|
||
"""Draw the `Annotation` object to the given *renderer*.""" |
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.
inherit docstring?
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.
The inherited one would be "Draw the Text
object to the given renderer.", which is slightly confusing. Right now, I can't think of a generic version that would suit both. So would leave this in.
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.
Text.draw could also be inherited, I guess?
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.
The base is Artist.draw, which has a technical comment on subclassing. It's probably possible to find a generic way of expressing that, so that it's appropriate in all Artist subclasses. But for now, I think leaving the explicit docstrings is the simplest solution.
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 guess I'll fix the base docstring later.
5ef6f69
to
9a483f2
Compare
""" | ||
return self._horizontalalignment | ||
|
||
def get_unitless_position(self): | ||
"Return the unitless position of the text as a tuple (*x*, *y*)" | ||
"""Return the (x, y) unitless position of the text.""" |
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.
perhaps be consistent between
x, y
(x, y)
(*x*, *y*)
*(x, y)*
?
all of them occur right now in this patch.
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.
Gone with the simple (x, y)
.
PR Summary
The usual standardization of docstrings.