Skip to content

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

Merged
merged 3 commits into from
Mar 10, 2017
Merged

Conversation

choldgraf
Copy link
Contributor

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.

@choldgraf
Copy link
Contributor Author

Note that there is some degree of redundancy between histogram examples in the statistics folder now. Lemme know if it's worth trying to consolidate further and I can put in some time to do so.

Copy link
Member

@NelleV NelleV left a 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)


###############################################################################
Copy link
Member

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.

Copy link
Member

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 #)?

Copy link
Member

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.

Copy link
Member

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.

@NelleV NelleV changed the title Sg histograms [MRG+1] Sg histograms Mar 9, 2017
@NelleV
Copy link
Member

NelleV commented Mar 9, 2017

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.

@phobson phobson changed the title [MRG+1] Sg histograms [MRG+1] DOC: sphinx-gallery histograms Mar 9, 2017
@phobson
Copy link
Member

phobson commented Mar 9, 2017

This looks great. I'll come back to it can give it a more complete review later.

Copy link
Member

@QuLogic QuLogic left a 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)


###############################################################################
Copy link
Member

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 #)?

#
# 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing period.

# 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing period.

# --------------------------
#
# Customizing a 2D histogram is similar to the 1D case, you can control
# visual components such as the bin size or color normalization
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing period.

@NelleV NelleV merged commit eaf297a into matplotlib:master Mar 10, 2017
@QuLogic QuLogic added this to the 2.1 (next point release) milestone Mar 12, 2017
@QuLogic QuLogic changed the title [MRG+1] DOC: sphinx-gallery histograms DOC: sphinx-gallery histograms Mar 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants