-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC : Improves Documentation for stem_plot.py #11677
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
@story645 can you give a review please 😃 |
This is an effort in view of #11654. Just a general note: Wouldn't it make sense to write the explanation as text above the example and only use very short comments inside the code? |
x = np.linspace(0.1, 2 * np.pi, 10) | ||
|
||
""" |
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.
Thanks for the PR! This should go in the first comment, not inside the code.
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.
okay! I will make the changes. 😃
I'll add this below Example stem plot
. Is that okay?
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, that'd be great.
Could you also add something like:
#############################
# This example makes use of:
# * :meth:`matplotlib.axes.Axes.stem`
At the bottom of the example? This will make a backlink to .Axes.stem
that will then make a thumbnail of this example show up at: https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.stem.html
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.
sure!
will just add this at the end 👍 and update the PR
@gabru-md You'll have to drill down the ci/circleci Details above to see what didn't work in your doc build... |
plt.setp(baseline, color='r', linewidth=2) | ||
|
||
# displaying the plot |
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 think you don't need this comment.
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.
will remove this 👍
@@ -4,12 +4,28 @@ | |||
========= | |||
|
|||
Example stem plot. |
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.
note sure this line is helpful for explaining what's going 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.
will clear this out 👍
@@ -4,12 +4,28 @@ | |||
========= | |||
|
|||
Example stem plot. | |||
Stem plot plots vertical lines from baseline to the y-coordinate |
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 think this is awesome. So awesome in fact that I don't think you need the returns section.
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.
It was mentioned in the issue
For example, in the stem plot example below it is unclear what markerline, stemlines, and
baseline are relative the plot, and why plt.stem returns those three objects and what the plt.setp
function is doing.
Therefore I added the return section in the docs.
Incase, you want then I can remove them 👍
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.
Yeah, but I think you've now explained it so well in the blurb that you don't explicitly need the return.
@story645 can you please tell me how is the coverage being affected ? |
@@ -3,13 +3,23 @@ | |||
Stem Plot | |||
========= | |||
|
|||
Example stem plot. | |||
Stem plot plots vertical lines from baseline to the y-coordinate | |||
Plotting cosine(x) w.r.t x, using '-.' as the pattern |
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 prefer writing out "with respect to", but that's not a deal breaker.
Well, I was hoping to check CI, but its being flakey. The source looks fine, so I'll merge as is. If there are any bad mistakes we can fix after. Thanks a lot for the PR! |
…677-on-v2.2.2-doc Backport PR #11677 on branch v2.2.2-doc
PR Summary
This Pull Request improves the documentation of the
stem_plot.py
example.Adds enough information in the example file for the user to understand every step.
😸
PR Checklist