You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/mplhep/plot.py
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -664,6 +664,7 @@ def hist2dplot(
664
664
cmax=None,
665
665
ax: mpl.axes.Axes|None=None,
666
666
flow="hint",
667
+
binwnorm=None,
667
668
**kwargs,
668
669
):
669
670
"""
@@ -706,6 +707,9 @@ def hist2dplot(
706
707
Axes object (if None, last one is fetched or one is created)
707
708
flow : str, optional {"show", "sum","hint", None}
708
709
Whether plot the under/overflow bin. If "show", add additional under/overflow bin. If "sum", add the under/overflow bin content to first/last bin. "hint" would highlight the bins with under/overflow contents
710
+
binwnorm : float, optional
711
+
If true, convert sum weights to bin-width-normalized, with unit equal to
712
+
supplied value (usually you want to specify 1.)
709
713
**kwargs :
710
714
Keyword arguments passed to underlying matplotlib function - pcolormesh.
711
715
@@ -809,6 +813,15 @@ def hist2dplot(
809
813
810
814
X, Y=np.meshgrid(xbins, ybins)
811
815
816
+
ifbinwnormisnotNone:
817
+
# No error treatment so we can just scale the values
818
+
H=H*binwnorm
819
+
# Make sure x_bin_width and y_bin_width align with H's dimensions
0 commit comments