Histogram: option to control the bin range edges
Description
At the moment we're following the convention to handle the edges of the bin ranges as defined and used in GSL (https://www.gnu.org/software/gsl/doc/html/histogram.html):
Matplotlib (https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.hist.html) is following GSL's convention and is also using half-open bin ranges except the last bin range which is closed and includes the last value:
Octave is including the edge values automatically (https://octave.sourceforge.io/octave/function/hist.html):
Extreme values are lumped into the first and last bins.
Mathematica uses the same convention as GSL (https://reference.wolfram.com/language/ref/Histogram.html):
R is doing best here by offering options for how to handle the edge values with the default behavior to include the maximal value into the last bin as in matplotlib (https://www.rdocumentation.org/packages/graphics/versions/3.6.2/topics/hist):
Though the different conventions (include the maximal value into the last bin or only use it for the definition of the upper boundary) are valid and will have strong arguments in the different communities favoring one of them, our current convention might produce "unexpected results" for some of the users which is also mentioned in Mathematica's documentation. The proposal is to implement the same option and the default behavior as in R.
GSL doesn't offer any options to control this behavior. We'll either need to implement the calculation of bins and frequencies on our own or work internally with a "one more bin" as suggested in GSL's documentation and hide (don't draw) it.