Skip to content

Default bottom of Stepfilled histograms should be set according to ymin #4621

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
jenshnielsen opened this issue Jul 10, 2015 · 6 comments · Fixed by #14581
Closed

Default bottom of Stepfilled histograms should be set according to ymin #4621

jenshnielsen opened this issue Jul 10, 2015 · 6 comments · Fixed by #14581
Labels
Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
Milestone

Comments

@jenshnielsen
Copy link
Member

jenshnielsen commented Jul 10, 2015

Follow up to #4606 and #4608

Compare bar:

import numpy
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1,1)
hist1 = ax.hist(1, bins=1, normed=False, log=True, histtype='bar', label='No bottom', alpha=1, facecolor='red')
offset = 1e-9
ax.set_ylim(1e-4, 1.1)
ax.legend()
plt.show()

bar

to stepfilled:

import numpy
import matplotlib.pyplot as plt
fig, ax = plt.subplots(1,1)
hist1 = ax.hist(1, bins=1, normed=False, log=True, histtype='stepfilled', label='No bottom', alpha=1, facecolor='red')
offset = 1e-9
ax.set_ylim(1e-4, 1.1)
ax.legend()
plt.show()

stepfilled

Setting bottom is not really a correct solution since it shifts the top of the bar with the same amount

@tacaswell tacaswell modified the milestones: next point release, proposed next point release Jul 11, 2015
@petehuang
Copy link
Contributor

@jenshnielsen can you update the second code snippet? I think it's the same as the first. Thanks :)

@jenshnielsen
Copy link
Member Author

I don't remember this but I think it should be correct now

@tacaswell tacaswell added the Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues label Jan 10, 2017
@tacaswell
Copy link
Member

Tagged as medium difficulty because hist.

@tacaswell tacaswell modified the milestones: 2.1 (next point release), 2.2 (next next feature release) Oct 3, 2017
@Dhrumil0
Copy link

I was interested in working on this. Can you please verify some things. Currently, the bottom is set to be 1/logbase by default for a stepfilled graph set to a log scale. If the bottom parameter is provided, it's value is used instead. This seems to be the intended behaviour from the comments in the code. Is it supposed to be set to the lower ylim value instead when bottom isn't given?

@anntzer
Copy link
Contributor

anntzer commented Feb 14, 2018

Probably the correct fix is some variant of #9477.

@Dhrumil0
Copy link

Dhrumil0 commented Feb 14, 2018

I think this issue is somewhat different. Can you please clarify how the step filled histogram is supposed to behave when bottom isn't set. The code is setting the default to 1/ logbase which seems to be reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty: Medium https://matplotlib.org/devdocs/devel/contribute.html#good-first-issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants