for_step#
- Hist1d.for_step(extent_to=None)[source]#
Return arrays appropriate for plotting with
plt.step.By default,
plt.stepneeds the right edges of a bin and the corresponding bin value. See the where keyword argument.Attention
Don’t use anything else but
where="pre"(which is the default) inplt.step. Otherwise the histogram will be shifted.- Parameters:
- extent_to
float, optional Extent the edges to this value (useful if the resulting plot should start at, e.g., zero).
- extent_to
- Returns:
Examples
Plot
hist: Hist1d:plt.step(*hist.for_step())
If
where != "pre", the resulting histogram will be shifted!:plt.step(*hist.for_step(), where="mid") # this will have shifted bins