Skip to content

Commit e96271b

Browse files
committed
update freq_label handling + add Bode/Nyquist notebook
1 parent 010b184 commit e96271b

File tree

2 files changed

+1257
-2
lines changed

2 files changed

+1257
-2
lines changed

control/freqplot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
'freqplot.Hz': False, # Plot frequency in Hertz
5757
'freqplot.grid': True, # Turn on grid for gain and phase
5858
'freqplot.wrap_phase': False, # Wrap the phase plot at a given value
59-
'freqplot.freq_label': "Frequency [%s]",
59+
'freqplot.freq_label': "Frequency [{units}]",
6060
'freqplot.share_magnitude': 'row',
6161
'freqplot.share_phase': 'row',
6262
'freqplot.share_frequency': 'col',
@@ -894,7 +894,8 @@ def gen_zero_centered_series(val_min, val_max, period):
894894
ax_array[0, j].set_title(f"From {data[0].input_labels[j]}")
895895

896896
# Label the frequency axis
897-
ax_array[-1, j].set_xlabel(freq_label % ("Hz" if Hz else "rad/s",))
897+
ax_array[-1, j].set_xlabel(
898+
freq_label.format(units="Hz" if Hz else "rad/s"))
898899

899900
# Label the rows
900901
for i in range(noutputs if not overlay_outputs else 1):

0 commit comments

Comments
 (0)