@@ -126,27 +126,30 @@ def bode_plot(syslist, omega=None, dB=None, Hz=None, deg=None,
126
126
omega = default_frequency_range (syslist )
127
127
128
128
# Get the magnitude and phase of the system
129
- mag_tmp , phase_tmp , omega = sys .freqresp (omega )
129
+ mag_tmp , phase_tmp , omega_sys = sys .freqresp (omega )
130
130
mag = np .atleast_1d (np .squeeze (mag_tmp ))
131
131
phase = np .atleast_1d (np .squeeze (phase_tmp ))
132
132
phase = unwrap (phase )
133
- if Hz : omega = omega / (2 * sp .pi )
133
+ if Hz :
134
+ omega_plot = omega_sys / (2 * sp .pi )
135
+ else :
136
+ omega_plot = omega_sys
134
137
if dB : mag = 20 * sp .log10 (mag )
135
138
if deg : phase = phase * 180 / sp .pi
136
139
137
140
mags .append (mag )
138
141
phases .append (phase )
139
- omegas .append (omega )
142
+ omegas .append (omega_sys )
140
143
# Get the dimensions of the current axis, which we will divide up
141
144
#! TODO: Not current implemented; just use subplot for now
142
145
143
146
if (Plot ):
144
147
# Magnitude plot
145
148
plt .subplot (211 );
146
149
if dB :
147
- plt .semilogx (omega , mag , * args , ** kwargs )
150
+ plt .semilogx (omega_plot , mag , * args , ** kwargs )
148
151
else :
149
- plt .loglog (omega , mag , * args , ** kwargs )
152
+ plt .loglog (omega_plot , mag , * args , ** kwargs )
150
153
plt .hold (True );
151
154
152
155
# Add a grid to the plot + labeling
@@ -156,7 +159,7 @@ def bode_plot(syslist, omega=None, dB=None, Hz=None, deg=None,
156
159
157
160
# Phase plot
158
161
plt .subplot (212 );
159
- plt .semilogx (omega , phase , * args , ** kwargs )
162
+ plt .semilogx (omega_plot , phase , * args , ** kwargs )
160
163
plt .hold (True );
161
164
162
165
# Add a grid to the plot + labeling
0 commit comments