Skip to content

Commit 5438746

Browse files
committed
formatting code to make easier sgrid() function in future.
1 parent de87bb0 commit 5438746

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

control/rlocus.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def root_locus(sys, kvect=None, xlim=None, ylim=None, plotstr='-', Plot=True,
138138
ax.set_xlabel('Real')
139139
ax.set_ylabel('Imaginary')
140140
if grid:
141-
sgrid_func(f)
141+
_sgrid_func()
142142
return mymat, kvect
143143

144144

@@ -321,7 +321,9 @@ def _RLFeedbackClicks(event, sys):
321321
(s.real, s.imag, K.real, -1 * s.real / abs(s)))
322322

323323

324-
def sgrid_func(fig, zeta=None, wn=None):
324+
def _sgrid_func(fig=None, zeta=None, wn=None):
325+
if fig is None:
326+
fig = pylab.gcf()
325327
ax = fig.gca()
326328
ylocator = ax.get_yaxis().get_major_locator()
327329
xlocator = ax.get_xaxis().get_major_locator()

0 commit comments

Comments
 (0)