feat: added bar type + correct legend for step type
Part of the merging project, linked to this PR in plothist.
This PR adds:
- Two new
histtype:barandbarstep, which behave like matplotlib: if one histogram is providedbarandbarstepare equivalent tofillandstep. If multiple are provided, the bars or step are arranged side by side. Thebarstepcan also display y error bars (see tests/baseline/test_histplot_types.png and tests/baseline/test_histplot_bar.png) - The
steptype has now the same representation in the legend as in matplotlib. - By default,
yerris not shown forsteptype.
@andrzejnovak @jonas-eschle
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.
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).
If necessary we could add an argument to change the legend to a rectangle, but lets get the request first.