Closed qli84 closed 1 month ago
Thanks for the report! Is this possibly the same issue as #5036?
Thanks for the report! Is this possibly the same issue as #5036?
I think they are related. I compared issue #5036 with mine, both mistakes start at calculating shift
in the function bin_breaks_width
. In our examples, shift
should be 0 so that the origin
starts from the right place, but it gives 1.
With the following example, only 2 bins were drawn instead of specified 3.
However, by addtionally specifying the center, number of bins is correct.
Without specification of the center, this mistake happens exactly if $min \times(2\times bins + 1) = 3\times max$, where $min$ and $max$ is the minimum and maximum of the variable, respectively. This equation is equivalent to the situation where shift = 1 in the internal function
bin_breaks_width
.