Skip to content

Commit 92d172f

Browse files
committed
[nyquist-plot] color is None by default to allow drawing list of LTIs with different colors
1 parent be911f8 commit 92d172f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

control/freqplot.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ def gen_zero_centered_series(val_min, val_max, period):
324324
return mags, phases, omegas
325325

326326

327-
def nyquist_plot(syslist, omega=None, Plot=True, color='b',
327+
def nyquist_plot(syslist, omega=None, Plot=True, color=None,
328328
labelFreq=0, *args, **kwargs):
329329
"""
330330
Nyquist plot for a system
@@ -393,8 +393,9 @@ def nyquist_plot(syslist, omega=None, Plot=True, color='b',
393393

394394
if Plot:
395395
# Plot the primary curve and mirror image
396-
plt.plot(x, y, '-', color=color, *args, **kwargs)
397-
plt.plot(x, -y, '--', color=color, *args, **kwargs)
396+
p = plt.plot(x, y, '-', color=color, *args, **kwargs)
397+
c = p[0].get_color()
398+
plt.plot(x, -y, '-', color=c, *args, **kwargs)
398399
# Mark the -1 point
399400
plt.plot([-1], [0], 'r+')
400401

0 commit comments

Comments
 (0)