control.ControlPlot

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

A class for returning control figures.

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.

lines

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.

Type

array of list of matplotlib:Line2D

axes

Array of Axes objects for each subplot in the plot.

Type

2D array of matplotlib:Axes

figure

Figure on which the Axes are drawn.

Type

matplotlib:Figure

legend

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.

Type

matplotlib:.legend.Legend (instance or ndarray)

__init__(lines, axes=None, figure=None, legend=None)[source]

Methods

__init__(lines[, axes, figure, legend])

reshape(*args)

set_plot_title(title[, frame])

Set the title for a control plot.

Attributes

shape

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
  • title (str) – Title text.

  • fig (Figure, optional) – Matplotlib figure. Defaults to current figure.

  • frame (str, optional) – Coordinate frame to use for centering: ‘axes’ (default) or ‘figure’.

  • **kwargs (matplotlib.pyplot.suptitle() keywords, optional) – Additional keywords (passed to matplotlib).