Skip to content

log_bin_edges

Mojo function 🡭

log_bin_edges

fn def log_bin_edges(data: List[Float64], bins: Int = Int(10)) -> List[Float64]

bins + 1 boundaries even in log10 space over data’s range: the log-axis counterpart of bin_edges() (#718).

On a log axis, bins of equal width in data units come out wildly unequal on screen, so a bin’s area stops meaning anything. These are equal on screen instead: each one spans the same ratio.

Args:

  • data (List[Float64]): The observations, all positive.
  • bins (Int): How many bins.

Returns:

List[Float64]: The edges, in data units.

Raises:

Error: Empty data, a value at or below zero, or a non-positive bins.