Restore pyplot getter semantics for limits and ticks
HA
1d ago+405+405+012345678901234567890123456789-35-35-01234567890123456789
Fixes #443
Summary
- Restore Matplotlib-style getters and setters for
xlim/ylim, includingxmin/xmaxandymin/ymaxaliases. - Make
xticks/yticksreturn locations and label handles for reads and writes, with minor reads/results following the requested minor axis. - Preserve live
Legendhandles in the pyplot API and correct theAxesreturn 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, andgit diff --check— passed.- Pinned
reflex-releasechangelog 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/xmaxandymin/ymaxaliases. - 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.
- Plot limit controls return current or updated axis limits and accept
-
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.