In the explicit-margin log branch of the axis range computation (python/xy/_figure.py, out_lo = 10.0 ** (transformed_lo - pad) — lines ~1126–1130 at 9fdc236), the padded lower bound can underflow to 0.0: with e.g. data spanning lo=1e-300 to hi=1e10 and margin=0.1, transformed_lo - pad ≈ -331 and 10.0**-331 == 0.0, leaving a log axis with a non-positive lower bound.
The default-margin path already guards against this with a positive floor:
if scale == "log" and configured_margin is None:
out_lo = max(out_lo, lo / 10.0, np.nextafter(0.0, 1.0))
Fix sketch: apply the np.nextafter(0.0, 1.0) floor in the explicit-margin branch as well (only the floor — the lo / 10.0 clamp would defeat an authored margin), plus a regression test with a pathological-but-legal domain.
Provenance: pre-existing on main; surfaced by CodeRabbit while reviewing the merge commit in #347, where it is outside the diff and out of scope (that PR is a notebook display change).
In the explicit-margin log branch of the axis range computation (
python/xy/_figure.py,out_lo = 10.0 ** (transformed_lo - pad)— lines ~1126–1130 at9fdc236), the padded lower bound can underflow to0.0: with e.g. data spanninglo=1e-300tohi=1e10andmargin=0.1,transformed_lo - pad ≈ -331and10.0**-331 == 0.0, leaving a log axis with a non-positive lower bound.The default-margin path already guards against this with a positive floor:
Fix sketch: apply the
np.nextafter(0.0, 1.0)floor in the explicit-margin branch as well (only the floor — thelo / 10.0clamp would defeat an authored margin), plus a regression test with a pathological-but-legal domain.Provenance: pre-existing on
main; surfaced by CodeRabbit while reviewing the merge commit in #347, where it is outside the diff and out of scope (that PR is a notebook display change).