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
  • data (list of FrequencyResponseData) – List of FrequencyResponseData objects. For backward compatibility, a list of LTI systems can also be given.

  • omega (array_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. The omega parameter must be present (use omega=None if needed).

  • dB (bool) – If True, plot result in dB. Default is False.

  • Hz (bool) – 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.

  • 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.

  • color (matplotlib color spec) – Color to use for singular values (or None for matplotlib default).

  • grid (bool) – If True, plot grid lines on gain and phase plots. Default is set by config.defaults[‘freqplot.grid’].

  • label (str 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_loc (int 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_limits (array_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 providing omega_limits.

  • omega_num (int, optional) – Number of samples to use for the frequeny range. Defaults to config.defaults[‘freqplot.number_of_samples’]. Ignored if data is not a list of systems.

  • plot (bool, 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.

  • rcParams (dict) – Override the default parameters used for generating plots. Default is set up config.default[‘ctrlplot.rcParams’].

  • show_legend (bool, 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 or legend_map has been specified.

  • title (str, optional) – Set the title of the plot. Defaults to plot type and system name(s).

  • title_frame (str, 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).

Returns

cplt

Object containing the data that were plotted:

  • cplt.lines: 1-D array of matplotlib.lines.Line2D objects. 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.axes: 2D array of matplotlib.axes.Axes for the plot.

  • cplt.figure: matplotlib.figure.Figure containing the plot.

  • cplt.legend: legend object(s) contained in the plot

See ControlPlot for more detailed information.

Return type

ControlPlot object

Notes

  1. If plot==False, the following legacy values are returned:
    • magndarray (or list of ndarray if len(data) > 1))

      Magnitude of the response (deprecated).

    • phasendarray (or list of ndarray if len(data) > 1))

      Phase in radians of the response (deprecated).

    • omegandarray (or list of ndarray if len(data) > 1))

      Frequency in rad/sec (deprecated).