histogram_line
- sherpa.plot.utils.histogram_line(xlo, xhi, y)[source] [edit on github]
Manually create x, y arrays for draw histrogram line
Draw the data as a histogram, manually creating the lines from the low to high edge of each bin. In the case on non-consequtive bins, the line will have some nan values, so that disjoint lines are drawn.
In matplotlib, an alternative would be to create RectanglePatches, one for each bin, but I don’t want each bin to go down to 0. I do not find the existing drawstyle options to be sufficient.
- Parameters:
xlo (array) – Lower and upper bin boundaries. Typically,
xlo
will contain the lower boundary andxhi
the upper boundary, but this function can deal with situations where that is reversed. Both arrays have to be monotonically increasing or decreasing.xhi (array) – Lower and upper bin boundaries. Typically,
xlo
will contain the lower boundary andxhi
the upper boundary, but this function can deal with situations where that is reversed. Both arrays have to be monotonically increasing or decreasing.y (array) – Dependent values for each histrogram bin_hi
- Returns:
x, y2 – x and y arrays for plotting the histogram line.
- Return type:
array