Skip to content

Bug #4414 #6169

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

Closed
wants to merge 4 commits into from
Closed

Bug #4414 #6169

wants to merge 4 commits into from

Conversation

CrazyKsv
Copy link

Based on the previous class definition of hist(), if only histtype=’stepfilled’ is passed, then normed will default to false and together it causes the histogram to calculate its y-axis limits based on the graphing data. If only normed=True is passed, then histtype will default to ‘bar’ and together it causes the histogram to scale it’s y-axis limits after normalizing graph data. However, when both are provided, the y-axis limits are calculated instead of being scaled, because the previous code does not check if normed=True, which should override the manual calculations of y-axis limits.

The bugfix code involves an if statement in the matplotlib/lib/matplotlib/axes/_axes.py hist(...) method that checks the histtype and normed parameters to sets the y limit accordingly. As mentioned above, if the histtype property were not given, then the algorithm would simply scale the graph as if it were a bargraph. However, this is not the case with histtype = “stepfilled”. Since histtype = “stepfilled” is given, it will not scale according to the data, which is why it is imperative to determine the method of scaling before any calculations. The best way to do this is by using an if statement when histtype=’stepfilled’ to check the value of the normed property, and scale accordingly(i.e. Manually calculate dimensions if data not normalized normed=False vs. Auto scale if data is normalized normed=True).
#4414

@CrazyKsv CrazyKsv changed the title Bug#4414 Bug #4414 Mar 16, 2016
@CrazyKsv CrazyKsv closed this Mar 16, 2016
@CrazyKsv CrazyKsv deleted the bug#4414 branch March 16, 2016 22:37
@ghost ghost mentioned this pull request Mar 16, 2016
@tacaswell tacaswell mentioned this pull request Mar 17, 2016
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.

3 participants