-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
DOC: sphinx-gallery histograms #8245
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
Note that there is some degree of redundancy between histogram examples in 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.
Great job @choldgraf ! I really like this tutorial form of examples.
np.random.seed(19680801) | ||
|
||
|
||
############################################################################### |
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.
For reviews, this syntax in sphinx gallery is supported to convert this into text in both the html and to a text block in the jupyter notebook version of 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.
Doesn't this cause a PEP8 error (No space after #
)?
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.
flake8 doesn't complain about it.
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.
OK, turns out these are E265 and E266, but we've got them in our global ignore list.
My opinion is that we should take baby steps: this is already a great improvement to our examples and gallery. We can consolidate with other histogram examples later, though it is definitely on my TODO list. |
This looks great. I'll come back to it can give it a more complete review later. |
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.
Sentences that are part of paragraph prose should end with periods.
Up to you if you want to add them to the single-line comments also.
np.random.seed(19680801) | ||
|
||
|
||
############################################################################### |
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.
Doesn't this cause a PEP8 error (No space after #
)?
examples/statistics/plot_hist.py
Outdated
# | ||
# To generate a 1D histogram we only need a single vector of numbers. For a 2D | ||
# histogram we'll need a second vector. We'll generate both below, and show | ||
# the histogram for each vector |
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.
Trailing period.
examples/statistics/plot_hist.py
Outdated
# The histogram method returns (among other things) a `patches` object. This | ||
# gives us access to the properties of the objects drawn. Using this, we can | ||
# edit the histogram to our liking. Let's change the color of each bar | ||
# based on its y value |
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.
Trailing period.
examples/statistics/plot_hist.py
Outdated
# -------------------------- | ||
# | ||
# Customizing a 2D histogram is similar to the 1D case, you can control | ||
# visual components such as the bin size or color normalization |
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.
Trailing period.
This attempts to consolidate a bunch of very short examples for histograms that were in the pylab folder into a longer-form example that's suitable for deploying with sphinx-gallery.