Skip to content
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

feat: added bar type #529

Merged
merged 7 commits into from
Oct 29, 2024
Merged

Conversation

0ctagon
Copy link
Member

@0ctagon 0ctagon commented Oct 20, 2024

Part of the merging project, linked to this PR in plothist.

This PR adds:

  1. Two new histtype: bar and barstep, which behave like matplotlib: if one histogram is provided bar and barstep are equivalent to fill and step. If multiple are provided, the bars or step are arranged side by side. The barstep can also display y error bars (see tests/baseline/test_histplot_types.png and tests/baseline/test_histplot_bar.png)
  2. The step type has now the same representation in the legend as in matplotlib -> removed.
  3. By default, yerr is not shown for step type -> removed.

@andrzejnovak @jonas-eschle

@andrzejnovak
Copy link
Member

This is great! I think we don't want to change the default behaviour of yerr for step. We had a discussion on the topic in the past and iirc the conclusion was that we want to let the user "know" right away if the object has that kind of information.

@0ctagon
Copy link
Member Author

0ctagon commented Oct 24, 2024

I understand the reason and I reverted back to how it was before.
As matplotlib doesn't really support step with errorbar, in plothist we would represent them with what corresponds to the band type in mplhep. I think we will need a good section in the doc on how the errors are handled and displayed (in the current plothist doc, everything is boost-histogram so everything has errors already, which overloads a bit all the plots with yerr=True by default).

@0ctagon
Copy link
Member Author

0ctagon commented Oct 29, 2024

If necessary we could add an argument to change the legend to a rectangle, but lets get the request first.

@andrzejnovak andrzejnovak merged commit 702a55b into scikit-hep:main Oct 29, 2024
12 checks passed
@0ctagon 0ctagon changed the title feat: added bar type + correct legend for step type feat: added bar type Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants