Matplotlib’s PlotBase

Definition of the base class for the matplotlib plot objects.

Classes:

MplPlotBase(inertial_frame, zero_point, ...)

Class with the basic attributes and methods for the plot objects.

class symmeplot.matplotlib.plot_base.MplPlotBase(inertial_frame: sympy.physics.vector.frame.ReferenceFrame, zero_point: sympy.physics.vector.point.Point, sympy_object: object, name: str | None = None)

Bases: PlotBase

Class with the basic attributes and methods for the plot objects.

Parameters:

Methods:

add_artist(artist, exprs)

Add an artist to the plot object.

contains(event)

Boolean whether one of the artists contains the event.

get_expressions_to_evaluate()

Return a tuple of the necessary expressions for plotting.

get_sympy_object_exprs()

Return the expressions used in plotting the sympy object.

plot([ax])

Plot the associated plot objects.

update()

Update the objects on the scene, based on the current values.

Attributes:

annot_coords

Coordinate where the annotation text is displayed.

artists

Artists used to plot the object.

children

Child objects in the plot hierarchy.

inertial_frame

The reference frame with respect to which the object is oriented.

name

Name of the plot object.

sympy_object

The absolute origin with respect to which the object is positioned.

values

List of evaluated values for the object's variables.

visible

If the object is be visible in the plot.

zero_point

The absolute origin with respect to which the object is positioned.

add_artist(artist: ArtistBase, exprs: Expr | tuple[Expr, ...]) None

Add an artist to the plot object.

Parameters:
  • artist (ArtistBase) – The artist to be added.

  • exprs (expression or tuple of expressions) – Args used to update the artist in the form of expressions.

abstract property annot_coords: Sequence[float]

Coordinate where the annotation text is displayed.

property artists: tuple[ArtistBase, ...]

Artists used to plot the object.

property children: tuple[PlotBase, ...]

Child objects in the plot hierarchy.

contains(event: MouseEvent) bool

Boolean whether one of the artists contains the event.

get_expressions_to_evaluate() tuple

Return a tuple of the necessary expressions for plotting.

get_sympy_object_exprs() tuple[Any, ...]

Return the expressions used in plotting the sympy object.

property inertial_frame: sympy.physics.vector.frame.ReferenceFrame

The reference frame with respect to which the object is oriented.

property name: str

Name of the plot object. Default is the name of the object being plotted.

plot(ax: Axes | None = None) None

Plot the associated plot objects.

Explanation

Add the objects artists to the matplotlib axes. Note that the object should be evaluated before plotting.

Parameters:

ax (matplotlib.axes._subplots.Axes3DSubplot, optional) – Axes on which the artist should be added. The default is the active axes.

property sympy_object: object

The absolute origin with respect to which the object is positioned.

update() None

Update the objects on the scene, based on the current values.

property values: tuple

List of evaluated values for the object’s variables.

property visible: bool

If the object is be visible in the plot.

property zero_point: sympy.physics.vector.point.Point

The absolute origin with respect to which the object is positioned.