control.ControlPlot

class control.ControlPlot(lines, axes=None, figure=None, legend=None)[source]

Bases: object

Return class for control platting functions.

This class is used as the return type for control plotting functions. It contains the information required to access portions of the plot that the user might want to adjust, as well as providing methods to modify some of the properties of the plot.

A control figure consists of a matplotlib.figure.Figure with an array of matplotlib.axes.Axes. Each axes in the figure has a number of lines that represent the data for the plot. There may also be a legend present in one or more of the axes.

Parameters
linesarray of list of matplotlib.lines.Line2D

Array of Line2D objects for each line in the plot. Generally, the shape of the array matches the subplots shape and the value of the array is a list of Line2D objects in that subplot. Some plotting functions will return variants of this structure, as described in the individual documentation for the functions.

axes2D array of matplotlib.axes.Axes

Array of Axes objects for each subplot in the plot.

figurematplotlib.figure.Figure

Figure on which the Axes are drawn.

legendmatplotlib.legend.Legend (instance or ndarray)

Legend object(s) for the plot. If more than one legend is included, this will be an array with each entry being either None (for no legend) or a legend object.

Attributes

shape

Methods

reshape

Reshape lines array (legacy).

set_plot_title

Set the title for a control plot.

reshape(*args)[source]

Reshape lines array (legacy).

set_plot_title(title, frame='axes')[source]

Set the title for a control plot.

This is a wrapper for the matplotlib suptitle function, but by setting frame to ‘axes’ (default) then the title is centered on the midpoint of the axes in the figure, rather than the center of the figure. This usually looks better (particularly with multi-panel plots), though it takes longer to render.

Parameters
titlestr

Title text.

figFigure, optional

Matplotlib figure. Defaults to current figure.

framestr, optional

Coordinate frame for centering: ‘axes’ (default) or ‘figure’.

**kwargsmatplotlib.pyplot.suptitle keywords, optional

Additional keywords (passed to matplotlib).