Skip to content

Commit b6d08de

Browse files
committed
docs: update histplot docs
1 parent bad5541 commit b6d08de

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

src/mplhep/plot.py

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def histplot(
9090
9191
Or list thereof.
9292
bins : iterable, optional
93-
Histogram bins, if not part of ``h``.
93+
Histogram bins, if not part of ``H``.
9494
yerr : iterable or bool, optional
9595
Histogram uncertainties. Following modes are supported:
9696
- True, sqrt(N) errors or poissonian interval when ``w2`` is specified
@@ -115,12 +115,13 @@ def histplot(
115115
binwnorm : float, optional
116116
If true, convert sum weights to bin-width-normalized, with unit equal to
117117
supplied value (usually you want to specify 1.)
118-
histtype: {'step', 'fill', 'errorbar'}, optional, default: "step"
118+
histtype: {'step', 'fill', 'band', 'errorbar'}, optional, default: "step"
119119
Type of histogram to plot:
120120
121-
- "step": skyline/step/outline of a histogram using `plt.step <https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.axes.Axes.step.html#matplotlib.axes.Axes.step>`_
122-
- "fill": filled histogram using `plt.fill_between <https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.axes.Axes.step.html#matplotlib.axes.Axes.step>`_
123-
- "errorbar": single marker histogram using `plt.errorbar <https://matplotlib.org/3.1.1/api/_as_gen/matplotlib.axes.Axes.step.html#matplotlib.axes.Axes.step>`_
121+
- "step": skyline/step/outline of a histogram using `plt.stairs <https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.stairs.html#matplotlib-axes-axes-stairs>`_
122+
- "fill": filled histogram using `plt.stairs <https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.stairs.html#matplotlib-axes-axes-stairs>`_
123+
- "step": filled band spanning the yerr range of the histogram using `plt.stairs <https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.stairs.html#matplotlib-axes-axes-stairs>`_
124+
- "errorbar": single marker histogram using `plt.errorbar <https://matplotlib.org/stable/api/_as_gen/matplotlib.axes.Axes.errorbar.html#matplotlib-axes-axes-errorbar>`_
124125
xerr: bool or float, optional
125126
Size of xerr if ``histtype == 'errorbar'``. If ``True``, bin-width will be used.
126127
label : str or list, optional
@@ -134,10 +135,11 @@ def histplot(
134135
ax : matplotlib.axes.Axes, optional
135136
Axes object (if None, last one is fetched or one is created)
136137
flow : str, optional { "show", "sum", "hint", "none"}
137-
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.
138+
Whether plot the under/overflow bin. If "show", add additional under/overflow bin.
139+
If "sum", add the under/overflow bin content to first/last bin.
138140
**kwargs :
139141
Keyword arguments passed to underlying matplotlib functions -
140-
{'step', 'fill_between', 'errorbar'}.
142+
{'stairs', 'errorbar'}.
141143
Returns
142144
-------
143145
List[Hist1DArtists]
@@ -465,8 +467,9 @@ def iterable_not_string(arg):
465467
elif histtype == "band":
466468
band_defaults = {
467469
"alpha": 0.5,
468-
"edgecolor": "lightgray",
469-
"hatch": "///",
470+
"edgecolor": "darkgray",
471+
"facecolor": "whitesmoke",
472+
"hatch": "//// /",
470473
}
471474
for i in range(len(plottables)):
472475
_kwargs = _chunked_kwargs[i]

0 commit comments

Comments
 (0)