Minor improvements concerning #6353 and #6357 #6386

Merged
merged 4 commits into from May 9, 2016

Conversation

Projects
None yet
5 participants
Contributor

khyox commented May 8, 2016

Related with #6353 and #6357, this commit corrects ylabel string in histogram_demo_features.py example but also tries to improve the documentation of hist in pyplot to clarify which one of the two common ways to normalize the counts is available through this option and which is not, in order to avoid future misunderstandings.

khyox added some commits May 6, 2016

@khyox khyox Correct ylabel in histogram_demo_features.py example 5a4be4c
@khyox khyox Improve the doc of hist in pyplot
Extend the description about the normed option for histograms (hist) to clarify which one of the two common ways to normalize the counts is available through this option and which is not.
f1d075b

mdboom added the needs_review label May 8, 2016

tacaswell closed this May 8, 2016

tacaswell reopened this May 8, 2016

@tacaswell tacaswell added needs_review and removed needs_review labels May 8, 2016

Owner

tacaswell commented May 8, 2016

power-cycled to re-run CI against current master (which has had some un-related fixes applied).

@tacaswell tacaswell and 1 other commented on an outdated diff May 8, 2016

lib/matplotlib/axes/_axes.py
@@ -5801,9 +5801,11 @@ def hist(self, x, bins=None, range=None, normed=False, weights=None,
normed : boolean, optional
If `True`, the first element of the return tuple will
be the counts normalized to form a probability density, i.e.,
- ``n/(len(x)`dbin)``, i.e., the integral of the histogram will sum
- to 1. If *stacked* is also *True*, the sum of the histograms is
- normalized to 1.
+ the integral of the histogram will sum to 1. So, the normalized
@tacaswell

tacaswell May 8, 2016

Owner

Can you flip this sentence to say what it is first (before saying what it is not) and make it a bit terser?

Can we assume are audience knows calculus?

@khyox

khyox May 8, 2016

Contributor

Ok, Thomas, no problem flipping it. Anyway, these two normalization methods of histograms are somehow like miles and kilometers, in the sense that you can say 'Hey, this is not in kilometers, this is in miles'. I can also switch 'the integral of the histogram will sum to 1' to 'the area (or integral) under the histogram will sum to one'.

@khyox

khyox May 9, 2016

Contributor

I hope it is right now from your point of view. I flipped and shortened the explanation. I think it is in the limit to be useful to avoid new confusion about the normalization method that is applied. Thanks.

@khyox khyox Adjust some doc of hist in pyplot
Tries to introduce the suggestions of Thomas in #6386.
d6a8e5f
Owner

jenshnielsen commented May 9, 2016

The remaining issue on Travis is a whitespace issue from pep8

/home/travis/build/matplotlib/matplotlib/lib/matplotlib/axes/_axes.py:5807:73: W291 trailing whitespace

@khyox khyox Avoid trailing whitespace in comment in _axes.py
Correct pep8 deviation in _axes.py:5807:73: W291 trailing whitespace
b8f52ad
Contributor

khyox commented May 9, 2016

Many thanks @jenshnielsen! It should be right now. Let us see the result of the tests...

@tacaswell tacaswell merged commit aeb6112 into matplotlib:master May 9, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 69.641%
Details
Owner

tacaswell commented May 9, 2016

Thanks!

tacaswell removed the needs_review label May 9, 2016

Contributor

khyox commented May 9, 2016

@tacaswell, @jenshnielsen: Sorry, I know I made this a bit painful! 😌 Thank you for your patience and help! 😉

Owner

tacaswell commented May 9, 2016

Thank you for being patient with us.

QuLogic added this to the 2.1 (next point release) milestone May 10, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment