Bug introduced in 8.0.4 and persisting through 13.2.0
Not really a question, more a solution to what I call a bug in mathematica v8(.0.0.4). I already sent a bug report to Wolfram.
Problem
The documentation for the Histogram-function explains the following option.
{"Log",bspec} apply binning bspec on log-transformed data.
When specifying the bins in the format {xMin, xMax, dx}
, these values are not processed corretly which leads to insatisfying results.
In detail, the lower and upper bounds are transformed to the logarithmic scale using the natural logarithm. From there on, the bin widths are determined using dx
and these bin coordinates are transformed back using the common logarithm. One would expect that the routine uses either the natural or the common logarithm for both operations, but not a mixture of the two.
Example
Imagine, that data
is a list of real values.
(* binning settings *)
binMin = 0.01;
binMax = 100;
binWidthLog = 1;
Histogram[data, {"Log", {binMin, binMax, binWidthLog}}]
The minimum and maximum x
values clearly don't follow the wanted behaviour. Using custom bin limits, this result can be reproduced as follows with a mixture of common and natural logarithms.
bins = {10^Range[Log[E, binMin], Log[E, binMax], binWidthLog]};
Histogram[data, {"Log", bins}]