Pyqtgraph’s Plot Objects#

Classes:

PlotBody(inertial_frame, zero_point, body[, ...])

A class for plotting a body in 3D using pyqtgraph.

PlotFrame(inertial_frame, zero_point, frame)

A class for plotting a ReferenceFrame in 3D using pyqtgraph.

PlotLine(inertial_frame, zero_point, line[, ...])

A class for plotting lines in 3D using pyqtgraph.

PlotPoint(inertial_frame, zero_point, point)

A class for plotting a Point in 3D using pyqtgraph.

PlotVector(inertial_frame, zero_point, vector)

A class for plotting a Vector in 3D using pyqtgraph.

class symmeplot.pyqtgraph.plot_objects.PlotBody(inertial_frame: ReferenceFrame, zero_point: Point, body: Particle | RigidBody, name: str | None = None, style: str = 'default', plot_point_properties: dict | None = None, plot_frame_properties: dict | None = None, **kwargs)#

Bases: PlotBodyMixin, PgPlotBase

A class for plotting a body in 3D using pyqtgraph.

Parameters:
  • inertial_frame (sympy.physics.vector.frame.ReferenceFrame) – The reference frame with respect to which the object is oriented.

  • zero_point (sympy.physics.vector.point.Point) – The absolute origin with respect to which the object is positioned.

  • body (sympy.physics.mechanics.rigidbody.RigidBody or sympy.physics.mechanics.particle.Particle) – The body that should be plotted.

  • origin (sympy.physics.vector.point.Point or sympy.physics.vector.vector.Vector, optional) – The origin of the frame with respect to the zero_point. If a sympy.physics.vector.vector.Vector is provided the origin is at the tip of the vector with respect to the zero_point. Default is zero_point.

  • style (str, optional) – Reference to what style should be used for plotting the body. The default style is 'default'. Available styles: - None: No properties of the vectors will be set. - ‘default’: Uses a frame with as color ‘rgb’ for xyz.

  • plot_frame_properties (dict, optional) – Dictionary of keyword arguments that should be parsed to the symemplot.pyqtgraph.plot_objects.PlotFrame.

  • plot_point_properties (dict, optional) – Dictionary of keyword arguments that should be parsed to the symemplot.pyqtgraph.plot_objects.PlotPoint representing the center of mass.

  • **kwargs (dict, optional) – Kwargs that are parsed to both internally used plot objects.

Methods:

add_artist(artist, exprs)

Add an artist to the plot object.

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(view)

Plot the associated plot objects.

update()

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

Attributes:

artists

Artists used to plot the object.

body

The sympy body, which is being plotted.

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.

plot_frame

PlotFrame used for plotting the reference frame of the body.

plot_masscenter

PlotPoint used for plotting the center of mass of the body.

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, ...])#

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.

property artists: tuple[ArtistBase, ...]#

Artists used to plot the object.

property body: Particle | RigidBody#

The sympy body, which is being plotted.

property children: tuple[PlotBase, ...]#

Child objects in the plot hierarchy.

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(view: gl.GLViewWidget)#

Plot the associated plot objects.

property plot_frame: PlotBase | None#

PlotFrame used for plotting the reference frame of the body.

property plot_masscenter: PlotBase#

PlotPoint used for plotting the center of mass of the body.

property sympy_object: Any#

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

update() None#

Update the objects on the scene, based on the currect 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.

class symmeplot.pyqtgraph.plot_objects.PlotFrame(inertial_frame: ReferenceFrame, zero_point: Point, frame: ReferenceFrame, origin: Point | Vector | None = None, name: str | None = None, scale: float = 0.1, style: str = 'default', **kwargs)#

Bases: PlotFrameMixin, PgPlotBase

A class for plotting a ReferenceFrame in 3D using pyqtgraph.

Parameters:
  • inertial_frame (sympy.physics.vector.frame.ReferenceFrame) – The reference frame with respect to which the object is oriented.

  • zero_point (sympy.physics.vector.point.Point) – The absolute origin with respect to which the object is positioned.

  • frame (sympy.physics.vector.frame.ReferenceFrame) – The reference frame that should be plotted.

  • origin (sympy.physics.vector.point.Point or sympy.physics.vector.vector.Vector, optional) – The origin of the frame with respect to the zero_point. If a sympy.physics.vector.vector.Vector is provided the origin is at the tip of the vector with respect to the zero_point. Default is zero_point.

  • style (str, optional) – Reference to what style should be used for plotting the frame. The default style is 'default'. Available styles: - None: No properties of the vectors will be set. - ‘default’: Nice default frame with as color ‘rgb’ for xyz.

  • scale (float, optional) – Length of the vectors of the reference frame.

  • **kwargs (dict, optional) – Kwargs that are parsed to symmeplot.pyqtgraph.plot_objects.PlotVector`s, which possibly parses them to :class:`pyqtgraph.opengl.items.GLLinePlotItem, so color=(1, 0, 0, 1) will make all vectors of the reference frame red.

Methods:

add_artist(artist, exprs)

Add an artist to the plot object.

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(view)

Plot the associated plot objects.

update()

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

Attributes:

artists

Artists used to plot the object.

children

Child objects in the plot hierarchy.

frame

The sympy ReferenceFrame, which is being plotted.

inertial_frame

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

name

Name of the plot object.

origin

The origin of the object with respect to the zero_point.

sympy_object

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

values

List of evaluated values for the object's variables.

vectors

The PlotVectors used to plot the reference frame.

visible

If the object is be visible in the plot.

x

PlotVector used for the unit vector in the x direction.

y

PlotVector used for the unit vector in the y direction.

z

PlotVector used for the unit vector in the z direction.

zero_point

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

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

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.

property artists: tuple[ArtistBase, ...]#

Artists used to plot the object.

property children: tuple[PlotBase, ...]#

Child objects in the plot hierarchy.

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

The sympy ReferenceFrame, which is being plotted.

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.

property origin: sympy.physics.vector.point.Point#

The origin of the object with respect to the zero_point.

plot(view: gl.GLViewWidget)#

Plot the associated plot objects.

property sympy_object: Any#

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

update() None#

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

property values: tuple#

List of evaluated values for the object’s variables.

property vectors: tuple[PlotBase, PlotBase, PlotBase]#

The PlotVectors used to plot the reference frame.

property visible: bool#

If the object is be visible in the plot.

property x: PlotBase#

PlotVector used for the unit vector in the x direction.

property y: PlotBase#

PlotVector used for the unit vector in the y direction.

property z: PlotBase#

PlotVector used for the unit vector in the z direction.

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

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

class symmeplot.pyqtgraph.plot_objects.PlotLine(inertial_frame: sympy.physics.vector.frame.ReferenceFrame, zero_point: sympy.physics.vector.point.Point, line: Iterable[sympy.physics.vector.point.Point], name: str | None = None, **kwargs)#

Bases: PlotLineMixin, PgPlotBase

A class for plotting lines in 3D using pyqtgraph.

Parameters:
  • inertial_frame (sympy.physics.vector.frame.ReferenceFrame) – The reference frame with respect to which the object is oriented.

  • zero_point (sympy.physics.vector.point.Point) – The absolute origin with respect to which the object is positioned.

  • points (list of sympy.physics.vector.point.Point or sympy.physics.vector.vector.Vector) – The points or vectors through which the line should be plotted with respect to the zero_point. If a vector is provided, the origin will be at the tip of the vector with respect to the zero_point.

  • name (str, optional) – The name of the line. Default is None.

  • **kwargs (dict, optional) – Kwargs that are parsed to pyqtgraph.opengl.items.GLLinePlotItem, so color=(1, 0, 0, 1) will make the plotted line red.

Methods:

add_artist(artist, exprs)

Add an artist to the plot object.

get_expressions_to_evaluate()

Return a tuple of the necessary expressions for plotting.

get_sympy_object_exprs()

Arguments of the sympy object artist in expression form.

plot(view)

Plot the associated plot objects.

update()

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

Attributes:

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.

line

The points that spawn the line.

line_coords

Coordinate values of the plotted line.

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, ...])#

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.

property artists: tuple[ArtistBase, ...]#

Artists used to plot the object.

property children: tuple[PlotBase, ...]#

Child objects in the plot hierarchy.

get_expressions_to_evaluate() tuple#

Return a tuple of the necessary expressions for plotting.

get_sympy_object_exprs() tuple[tuple[Expr, ...], ...]#

Arguments of the sympy object artist in expression form.

Notes

The form of the expression is ((x0, x1, ...), (y0, y1, ...), (z0, z1, ...)).

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

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

property line: tuple[sympy.physics.vector.point.Point, ...]#

The points that spawn the line.

property line_coords: ndarray[Any, dtype[float64]]#

Coordinate values of the plotted line.

property name: str#

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

plot(view: gl.GLViewWidget)#

Plot the associated plot objects.

property sympy_object: Any#

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

update() None#

Update the objects on the scene, based on the currect 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.

class symmeplot.pyqtgraph.plot_objects.PlotPoint(inertial_frame: sympy.physics.vector.frame.ReferenceFrame, zero_point: sympy.physics.vector.point.Point, point: sympy.physics.vector.point.Point, name: str | None = None, **kwargs)#

Bases: PlotPointMixin, PgPlotBase

A class for plotting a Point in 3D using pyqtgraph.

Parameters:
  • inertial_frame (sympy.physics.vector.frame.ReferenceFrame) – The reference frame with respect to which the object is oriented.

  • zero_point (sympy.physics.vector.point.Point) – The absolute origin with respect to which the object is positioned.

  • point (sympy.physics.vector.point.Point or sympy.physics.vector.vector.Vector) – The point or vector that should be plotted with respect to the zero_point. If a vector is provided, the origin will be at the tip of the vector with respect to the zero_point. If not specified, the default is the zero_point.

  • **kwargs (dict, optional) – Kwargs that are parsed to pyqtgraph.opengl.items.GLScatterPlotItem, so color=(1, 0, 0, 1) will make the plotted point red.

Methods:

add_artist(artist, exprs)

Add an artist to the plot object.

get_expressions_to_evaluate()

Return a tuple of the necessary expressions for plotting.

get_sympy_object_exprs()

Get coordinate of the point as expressions.

plot(view)

Plot the associated plot objects.

update()

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

Attributes:

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.

point

The sympy Point, which is being plotted.

point_coords

Coordinate values of the plotted point.

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, ...])#

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.

property artists: tuple[ArtistBase, ...]#

Artists used to plot the object.

property children: tuple[PlotBase, ...]#

Child objects in the plot hierarchy.

get_expressions_to_evaluate() tuple#

Return a tuple of the necessary expressions for plotting.

get_sympy_object_exprs() tuple[Expr, Expr, Expr]#

Get coordinate of the point as expressions.

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(view: gl.GLViewWidget)#

Plot the associated plot objects.

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

The sympy Point, which is being plotted.

property point_coords: ndarray[Any, dtype[float64]]#

Coordinate values of the plotted point.

property sympy_object: Any#

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

update() None#

Update the objects on the scene, based on the currect 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.

class symmeplot.pyqtgraph.plot_objects.PlotVector(inertial_frame: ReferenceFrame, zero_point: Point, vector: Vector, origin: Point | Vector | None = None, name: str | None = None, **kwargs)#

Bases: PlotVectorMixin, PgPlotBase

A class for plotting a Vector in 3D using pyqtgraph.

Parameters:

Methods:

add_artist(artist, exprs)

Add an artist to the plot object.

get_expressions_to_evaluate()

Return a tuple of the necessary expressions for plotting.

get_sympy_object_exprs()

Arguments of the sympy object artist in expression form.

plot(view)

Plot the associated plot objects.

update()

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

Attributes:

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.

origin

The origin of the object with respect to the zero_point.

origin_coords

Coordinate values of the origin of the plotted vector.

sympy_object

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

values

List of evaluated values for the object's variables.

vector

The sympy Vector, which is being plotted.

vector_values

Values of the plotted vector.

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, ...])#

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.

property artists: tuple[ArtistBase, ...]#

Artists used to plot the object.

property children: tuple[PlotBase, ...]#

Child objects in the plot hierarchy.

get_expressions_to_evaluate() tuple#

Return a tuple of the necessary expressions for plotting.

get_sympy_object_exprs() tuple[tuple[Expr, ...], tuple[Expr, ...]]#

Arguments of the sympy object artist in expression form.

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.

property origin: sympy.physics.vector.point.Point#

The origin of the object with respect to the zero_point.

property origin_coords: ndarray[Any, dtype[float64]]#

Coordinate values of the origin of the plotted vector.

plot(view: gl.GLViewWidget)#

Plot the associated plot objects.

property sympy_object: Any#

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

update() None#

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

property values: tuple#

List of evaluated values for the object’s variables.

property vector: sympy.physics.vector.vector.Vector#

The sympy Vector, which is being plotted.

property vector_values: ndarray[Any, dtype[float64]]#

Values of the plotted vector.

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.