Skip to content
pooled_extent

pooled_extent

Mojo function 🡭

pooled_extent

fn def pooled_extent(df: DataFrame, column: String, missing: Missing = Missing.DRAW) -> Tuple[Float64, Float64]

The (low, high) of a numeric column over the whole frame, for giving every facet panel the same axis.

A panel scaled from its own rows says nothing about the panel beside it: two peaks of different heights can be drawn the same size. Pass this to each panel’s scale_x_domain() or scale_y_domain() and the comparison a faceted figure invites becomes a fair one.

Missing values take no part, as everywhere else (#367).

Args:

  • df (DataFrame): The whole frame, before splitting.
  • column (String): The numeric column to measure.
  • missing (Missing): The policy in force (Theme.missing).

Returns:

Tuple[Float64, Float64]: The lowest and highest present value.

Raises:

Error: No such column, it is not numeric, or every value is missing.