control.singular_values_plot
- control.singular_values_plot(data, omega=None, *fmt, plot=None, omega_limits=None, omega_num=None, ax=None, label=None, title=None, **kwargs)[source]
Plot the singular values for a system.
Plot the singular values as a function of frequency for a system or list of systems. If multiple systems are plotted, each system in the list is plotted in a different color.
- Parameters
- datalist of
FrequencyResponseData
List of
FrequencyResponseData
objects. For backward compatibility, a list of LTI systems can also be given.- omegaarray_like
List of frequencies in rad/sec over to plot over.
- *fmt
matplotlib.pyplot.plot
format string, optional Passed to
matplotlib
as the format string for all lines in the plot. Theomega
parameter must be present (use omega=None if needed).- dBbool
If True, plot result in dB. Default is False.
- Hzbool
If True, plot frequency in Hz (omega must be provided in rad/sec). Default value (False) set by
config.defaults['freqplot.Hz']
.- **kwargs
matplotlib.pyplot.plot
keyword properties, optional Additional keywords passed to
matplotlib
to specify line properties.
- datalist of
- Returns
- cplt
ControlPlot
object Object containing the data that were plotted. See
ControlPlot
for more detailed information.- cplt.linesarray of
matplotlib.lines.Line2D
Array containing information on each line in the plot. The size of the array matches the number of systems and the value of the array is a list of Line2D objects for that system.
- cplt.axes2D array of
matplotlib.axes.Axes
Axes for each subplot.
- cplt.figure
matplotlib.figure.Figure
Figure containing the plot.
- cplt.legend2D array of
matplotlib.legend.Legend
Legend object(s) contained in the plot.
- cplt
- Other Parameters
- ax
matplotlib.axes.Axes
, optional The matplotlib axes to draw the figure on. If not specified and the current figure has a single axes, that axes is used. Otherwise, a new figure is created.
- colormatplotlib color spec
Color to use for singular values (or None for matplotlib default).
- gridbool
If True, plot grid lines on gain and phase plots. Default is set by
config.defaults['freqplot.grid']
.- labelstr or array_like of str, optional
If present, replace automatically generated label(s) with the given label(s). If sysdata is a list, strings should be specified for each system.
- legend_locint or str, optional
Include a legend in the given location. Default is ‘center right’, with no legend for a single response. Use False to suppress legend.
- omega_limitsarray_like of two values
Set limits for plotted frequency range. If Hz=True the limits are in Hz otherwise in rad/s. Specifying
omega
as a list of two elements is equivalent to providingomega_limits
.- omega_numint, optional
Number of samples to use for the frequency range. Defaults to
config.defaults['freqplot.number_of_samples']
. Ignored if data is not a list of systems.- plotbool, optional
(legacy) If given,
singular_values_plot
returns the legacy return values of magnitude, phase, and frequency. If False, just return the values with no plot.- rcParamsdict
Override the default parameters used for generating plots. Default is set up
config.defaults['ctrlplot.rcParams']
.- show_legendbool, optional
Force legend to be shown if True or hidden if False. If None, then show legend when there is more than one line on an axis or
legend_loc
orlegend_map
has been specified.- titlestr, optional
Set the title of the plot. Defaults to plot type and system name(s).
- title_framestr, optional
Set the frame of reference used to center the plot title. If set to ‘axes’ (default), the horizontal position of the title will centered relative to the axes. If set to ‘figure’, it will be centered with respect to the figure (faster execution).
- ax
See also
Notes
- If
plot
= False, the following legacy values are returned: mag
ndarray (or list of ndarray if len(data) > 1))Magnitude of the response (deprecated).
phase
ndarray (or list of ndarray if len(data) > 1))Phase in radians of the response (deprecated).
omega
ndarray (or list of ndarray if len(data) > 1))Frequency in rad/sec (deprecated).