recalculate loci for sisotool and rlocus on axis scaling by repagh · Pull Request #1153 · python-control/python-control
Pull Request Overview
This PR enables dynamic recalculation of root locus and pole-zero plots when the user pans or zooms in sisotool and rlocus, fixing issue #1151.
- Integrate
add_loci_recalculatecallback intosisotoolandroot_locus_plotfor auto-replot on axis changes - Extend
root_locus_mapsignature to acceptxlim,ylimand pass them through to gain calculation - Add
replotsupport for pole-zero maps via a newpole_zero_replotfunction
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| control/sisotool.py | Imported and invoked add_loci_recalculate, updated axis reference for root locus |
| control/rlocus.py | Added xlim/ylim parameters, defined add_loci_recalculate, wired callback in root_locus_plot |
| control/pzmap.py | Added replot method and pole_zero_replot for pole-zero redraw on zoom/pan |
Comments suppressed due to low confidence (2)
control/sisotool.py:141
- Variable
axesis undefined here; you likely meant to usefig.axesor the local axes variable instead ofaxes.
ax_rlocus = axes[0,1] #fig.axes[1]
control/pzmap.py:552
ControlPlotinstances expose their axes ascp.axes, notcp.ax. Update tocp.axes[0,0]to avoidAttributeError.
cp.lines[idx,2].append(cp.ax[0,0].plot(