Restore pyplot getter semantics for limits and ticks

HA
1d ago
+405-35

Fixes #443

Summary

  • Restore Matplotlib-style getters and setters for xlim/ylim, including xmin/xmax and ymin/ymax aliases.
  • Make xticks/yticks return locations and label handles for reads and writes, with minor reads/results following the requested minor axis.
  • Preserve live Legend handles in the pyplot API and correct the Axes return annotations.
  • Document the compatibility contract and add a bugfix news fragment.
  • Merge current upstream main.

Validation

  • Focused pyplot getter, resize, shared-panel sizing, inset/free-form/twin-axis, and limit-conflict regressions — 6 passed.
  • Full pyplot suite — 1,119 passed, 100 skipped; one unrelated pandas plotting test could not run because optional Matplotlib is not installed in this environment.
  • ty check python/xy/pyplot/_axes.py, Ruff check/format, and git diff --check — passed.
  • Pinned reflex-release changelog check, heading check, and generated workflow sync passed on the previous validation pass.
  • The generated JS bundle and Rust release build both completed locally.

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Plot limit controls return current or updated axis limits and accept xmin/xmax and ymin/ymax aliases.
    • Tick controls return tick locations and label handles. Calls without tick-setting arguments retrieve major ticks by default, or minor ticks with minor=True.
    • Legend creation returns a live legend handle.
  • Bug Fixes

    • Getter and setter results reflect the requested plotting operation.
    • Minor tick queries report locations consistent with the rendered plot, including after figure resizing.
    • Conflicting limit aliases and endpoint arguments are rejected.