Skip to content

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy