P_astro_project.mpl_utils

This script was produced by the LVK and it used for formatting plots.

Module Contents

Functions

limit_ax_oom(→ None)

Takes a matplotlib.axes._subplots.AxesSubplot object, and limits

P_astro_project.mpl_utils.limit_ax_oom(ax, n_oom: int, x_or_y: str, measure_from: str = 'upper', base: float = 10.0) None

Takes a matplotlib.axes._subplots.AxesSubplot object, and limits its limits to n_oom orders of magnitude (in the logarithmic base set by the base parameter, 10.0 by default) from either the upper or lower data limit (set with measure_from argument, “upper” by default). Either operates on x- or y-axis, set by passing “x” or “y” for x_or_y argument.

If the data limits are already within the specified orders of magnitude, no changes will be made.