-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Improve docstrings of Line2D #11922
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
Improve docstrings of Line2D #11922
Conversation
lib/matplotlib/lines.py
Outdated
connected with step-like lines, i.e. horizontal lines with | ||
vertical steps. | ||
The postfix pre/mid/post determines the position of the vertical | ||
step (directly after the left point / halfway between the |
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.
having "pre" correspond to "after the left point" sounds a bit confusing to me; I guess the more intuitive picture is "before the horizontal line" (and so on).
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 was stumbling over that already. For some reason I'm thinking more in "is the y-value of the line determined by the point to the left or to the right" not in where is the step (probably because I'm usually more interested in the value of the line than in the position of the step). Of course, "which is the relevant point" and "where is the step" are inverse to each other concerning pre/post 🙁. I've now extended the text to include both views. I hope that adds too the clarity and is not too verbose.
@@ -507,18 +507,27 @@ def set_pickradius(self, d): | |||
|
|||
def get_fillstyle(self): | |||
""" | |||
return the marker fillstyle | |||
Return the marker fillstyle. |
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.
Do you want to also wrap these one-liners back to, well, a single line too?
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 considering to add See also `.set_fillstyle`.
lines to the getters. That would undo the one-lining again.
I'm not quite decided yet if that's a good idea. So I left the one-liners as they are for the moment. Any comment on linking to the setters? I wouldn't want to use a "See also" section as that would get too verbose.
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.
Seems fine.
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 will leave that for a separate PR. IMO keeping the PRs reasonably small and not mixing too many aspects/concepts makes them easier to review.
b4b4567
to
413a236
Compare
lib/matplotlib/lines.py
Outdated
connected with step-like lines, i.e. horizontal lines with | ||
vertical steps. | ||
The postfix pre/mid/post determines the position of the vertical | ||
step (step at the beginning of the line segment, i.e. the line |
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 explanation starts becoming so long that it would perhaps read better as a nested list...
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.
New try. 😄
No description provided.