add_line¶
Class method.
-
do_mpc.graphics.Graphics.
add_line
(self, var_type, var_name, axis, **pltkwargs)¶ add_line
is called during setting up theGraphics
class. This is typically the last step of configuring do-mpc. Each call ofGraphics.add_line()
adds a line to the passed axis according to the variable type (_x
,_u
,_z
,_tvp
,_p
,_aux
) and its name (as defined in thedo_mpc.model.Model
). Furthermore, all valid matplotlib .plot arguments can be passed as optional keyword arguments, e.g.:linewidth
,color
,alpha
.Note
Lines can also be configured after adding them with this method. Use the
result_lines()
andpred_lines()
attributes for this purpose.Parameters: - var_type (string) – Variable type to be plotted. Valid arguments are
_x
,_u
,_z
,_tvp
,_p
,_aux
. - var_name (string) – Variable name. Must reference the names defined in the model for the given variable type.
- axis (matplotlib.axes.Axes object.) – Axis object on which to plot the line(s).
- pltkwargs (optional) – Valid matplotlib pyplot keyword arguments (e.g.:
linewidth
,color
,alpha
)
Raises: - assertion – var_type argument must be a string
- assertion – var_name argument must be a string
- assertion – var_type argument must reference to the valid var_types of do-mpc models.
- assertion – axis argument must be matplotlib axes object.
- var_type (string) – Variable type to be plotted. Valid arguments are
This page is auto-generated. Page source is not available on Github.