|
59 | 59 | from .xferfcn import _convert_to_transfer_function
|
60 | 60 | from .exception import ControlMIMONotImplemented
|
61 | 61 | from .sisotool import _SisotoolUpdate
|
62 |
| -from .grid import sgrid, zgrid |
| 62 | +from .grid import sgrid, zgrid, nogrid |
63 | 63 | from . import config
|
64 | 64 |
|
65 | 65 | __all__ = ['root_locus', 'rlocus']
|
@@ -220,27 +220,31 @@ def root_locus(sys, kvect=None, xlim=None, ylim=None, plotstr=None,
|
220 | 220 | for index, col in enumerate(mymat.T):
|
221 | 221 | ax.plot(real(col), imag(col), plotstr, label='rootlocus')
|
222 | 222 |
|
223 |
| - # Set up plot axes and labels |
224 |
| - ax.set_xlabel('Real') |
225 |
| - ax.set_ylabel('Imaginary') |
226 |
| - |
227 | 223 | # Draw the grid
|
228 | 224 | if grid:
|
229 | 225 | if isdtime(sys, strict=True):
|
230 | 226 | zgrid(ax=ax)
|
231 | 227 | else:
|
232 | 228 | _sgrid_func(fig=fig if sisotool else None)
|
233 | 229 | else:
|
| 230 | + # TODO: could some of the settings below be done with nogrid: |
| 231 | + #nogrid(ax=ax) |
| 232 | + # nogrid calls grid._final_setup() which has slightly different |
| 233 | + # settings for axhline and axvline linewidths and no zorder |
| 234 | + # setting. For now I am leaving the original commands below: |
234 | 235 | ax.axhline(0., linestyle=':', color='k', linewidth=.75, zorder=-20)
|
235 | 236 | ax.axvline(0., linestyle=':', color='k', linewidth=.75, zorder=-20)
|
236 | 237 | if isdtime(sys, strict=True):
|
237 | 238 | ax.add_patch(plt.Circle(
|
238 | 239 | (0, 0), radius=1.0, linestyle=':', edgecolor='k',
|
239 | 240 | linewidth=0.75, fill=False, zorder=-20))
|
| 241 | + ax.set_xlabel('Real') |
| 242 | + ax.set_ylabel('Imaginary') |
| 243 | + ax.axis('equal') |
240 | 244 |
|
241 | 245 | # Set the axes limits
|
242 |
| - # Note: I moved this to after computing grid lines above because |
243 |
| - # something in above was changing the xlim for discrete zgrid. |
| 246 | + # Note: I moved this to after the grid lines code above because |
| 247 | + # something in above was changing the xlim for discrete zgrids |
244 | 248 | if xlim:
|
245 | 249 | ax.set_xlim(xlim)
|
246 | 250 | if ylim:
|
|
0 commit comments