Skip to content

Commit bad993e

Browse files
committed
reformatting clicked cursor locations and gain
1 parent ffd8749 commit bad993e

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

control/rlocus.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ def root_locus(sys, kvect=None, xlim=None, ylim=None, plotstr='b' if int(matplot
133133
'button_release_event', partial(_RLClickDispatcher,sys=sys, fig=f,ax_rlocus=f.axes[0],plotstr=plotstr))
134134

135135
elif sisotool == True:
136-
f.axes[1].plot([root.real for root in start_mat], [root.imag for root in start_mat], 'm.', marker='s', markersize=8,zorder=20,label='gain_point')
137-
f.suptitle("pole: %10.4g%+10.4gj gain: %10.4g" % (start_mat[0][0].real, start_mat[0][0].imag, 1, -1 * start_mat[0][0].real / abs(start_mat[0][0])),fontsize = 12 if int(matplotlib.__version__[0]) == 1 else 10)
136+
f.axes[1].plot([root.real for root in start_mat], [root.imag for root in start_mat], 'm.', marker='x', markersize=8,zorder=20,label='gain_point')
137+
f.suptitle("pole: %4.2f%+4.2fj gain: %4.2f" % (start_mat[0][0].real, start_mat[0][0].imag, 1),fontsize = 12 if int(matplotlib.__version__[0]) == 1 else 10)
138138
f.canvas.mpl_connect(
139139
'button_release_event',partial(_RLClickDispatcher,sys=sys, fig=f,ax_rlocus=f.axes[1],plotstr=plotstr, sisotool=sisotool, bode_plot_params=kwargs['bode_plot_params'],tvect=kwargs['tvect']))
140140

@@ -478,21 +478,21 @@ def _RLFeedbackClicksPoint(event,sys,fig,ax_rlocus,sisotool=False):
478478
if abs(K.real) > 1e-8 and abs(K.imag / K.real) < gain_tolerance and event.inaxes == ax_rlocus.axes and K.real > 0.:
479479

480480
# Display the parameters in the output window and figure
481-
print("Clicked at %10.4g%+10.4gj gain %10.4g damp %10.4g" %
482-
(s.real, s.imag, K.real, -1 * s.real / abs(s)))
483-
fig.suptitle("Clicked at: %10.4g%+10.4gj gain: %10.4g damp: %10.4g" %
484-
(s.real, s.imag, K.real, -1 * s.real / abs(s)),fontsize = 12 if int(matplotlib.__version__[0]) == 1 else 10)
481+
print("pole: %4.2f%+4.2fj gain %4.2f" %
482+
(s.real, s.imag, K.real))
483+
fig.suptitle("pole: %4.2f%+4.2fj gain: %4.2f" %
484+
(s.real, s.imag, K.real),fontsize = 12 if int(matplotlib.__version__[0]) == 1 else 10)
485485

486486
# Remove the previous line
487487
_removeLine(label='gain_point',ax=ax_rlocus)
488488

489489
# Visualise clicked point, display all roots for sisotool mode
490490
if sisotool:
491491
mymat = _RLFindRoots(nump, denp, K.real)
492-
ax_rlocus.plot([root.real for root in mymat], [root.imag for root in mymat], 'm.', marker='s', markersize=8,
492+
ax_rlocus.plot([root.real for root in mymat], [root.imag for root in mymat], 'm.', marker='x', markersize=8,
493493
zorder=20,label='gain_point')
494494
else:
495-
ax_rlocus.plot(s.real, s.imag, 'k.', marker='s', markersize=8, zorder=20,label='gain_point')
495+
ax_rlocus.plot(s.real, s.imag, 'k.', marker='x', markersize=8, zorder=20,label='gain_point')
496496

497497
return K.real[0][0]
498498

0 commit comments

Comments
 (0)