8000 Merge pull request #871 from henklaak/fix_root_locus_ax · python-control/python-control@8972e82 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8972e82

Browse files
Merge pull request #871 from henklaak/fix_root_locus_ax
Fix root_locus() handling of ax parameter
2 parents 346bc40 + d13f1ed commit 8972e82

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

control/rlocus.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def root_locus(sys, kvect=None, xlim=None, ylim=None,
260260
if isdtime(sys, strict=True):
261261
zgrid(ax=ax)
262262
else:
263-
_sgrid_func(fig=fig if sisotool else None)
263+
_sgrid_func(ax)
264264
else:
265265
ax.axhline(0., linestyle=':', color='k', linewidth=.75, zorder=-20)
266266
ax.axvline(0., linestyle=':', color='k', linewidth=.75, zorder=-20)
@@ -660,13 +660,7 @@ def _removeLine(label, ax):
660660
del line
661661

662662

663-
def _sgrid_func(fig=None, zeta=None, wn=None):
664-
if fig is None:
665-
fig = plt.gcf()
666-
ax = fig.gca()
667-
else:
668-
ax = fig.axes[1]
669-
663+
def _sgrid_func(ax, zeta=None, wn=None):
670664
# Get locator function for x-axis, y-axis tick marks
671665
xlocator = ax.get_xaxis().get_major_locator()
672666
ylocator = ax.get_yaxis().get_major_locator()

0 commit comments

Comments
 (0)
0