Skip to content

For hist() with uneven bins, histtype=bar and stepfilled interpret align=left/right differently #12494

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

Open
anntzer opened this issue Oct 11, 2018 · 1 comment
Labels
keep Items to be ignored by the “Stale” Github Action topic: hist

Comments

@anntzer
Copy link
Contributor

anntzer commented Oct 11, 2018

Bug report

Bug summary

I'm not really sure what align=left/right is even supposed to mean for uneven bins, but at least histype=bar/stepfilled should interpret them in the same manner (or both should error out).

Code for reproduction

from pylab import *

np.random.seed(0)
t = np.random.rand(100)
fig, axs = plt.subplots(3, 2, sharex=True, sharey=True)
for i, align in enumerate(["left", "mid", "right"]):
    for j, ht in enumerate(["bar", "stepfilled"]):
        axs[i, j].hist(t, [0, 1/4, 1], histtype=ht, align=align)
        axs[i, j].set(xlabel=f"histtype={ht!r}", ylabel=f"align={align!r}")
        axs[i, j].label_outer()

plt.show()

Actual outcome

test

Expected outcome

Either consistent plots with both histtypes, or an error indicating that align=left/right is incompatible with uneven bins.

Matplotlib version

  • Operating system:
  • Matplotlib version: master
  • Matplotlib backend (print(matplotlib.get_backend())):
  • Python version:
  • Jupyter version (if applicable):
  • Other libraries:

Noted while thinking about #12493.

Copy link

github-actions bot commented Nov 3, 2023

This issue has been marked "inactive" because it has been 365 days since the last comment. If this issue is still present in recent Matplotlib releases, or the feature request is still wanted, please leave a comment and this label will be removed. If there are no updates in another 30 days, this issue will be automatically closed, but you are free to re-open or create a new issue if needed. We value issue reports, and this procedure is meant to help us resurface and prioritize issues that have not been addressed yet, not make them disappear. Thanks for your help!

@github-actions github-actions bot added the status: inactive Marked by the “Stale” Github Action label Nov 3, 2023
@anntzer anntzer added keep Items to be ignored by the “Stale” Github Action and removed status: inactive Marked by the “Stale” Github Action labels Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
keep Items to be ignored by the “Stale” Github Action topic: hist
Projects
None yet
Development

No branches or pull requests

2 participants