Pyqtgraph’s Plot Objects¶
PyQtGraph plot objects for plotting SymPy physics objects in 3D.
Classes:
| 
 | A class for plotting a body in 3D using pyqtgraph. | 
| 
 | A class for plotting a ReferenceFrame in 3D using pyqtgraph. | 
| 
 | A class for plotting lines in 3D using pyqtgraph. | 
| 
 | A class for plotting a Point in 3D using pyqtgraph. | 
| 
 | 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 | None = 'default', plot_point_properties: dict | None = None, plot_frame_properties: dict | None = None, **kwargs: object)¶
- 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.RigidBodyor- sympy.physics.mechanics.particle.Particle) – The body that should be plotted.
- origin ( - sympy.physics.vector.point.Pointor- sympy.physics.vector.vector.Vector, optional) – The origin of the frame with respect to the- zero_point. If a- sympy.physics.vector.vector.Vectoris provided the- originis 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.PlotPointrepresenting 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. - Return a tuple of the necessary expressions for plotting. - 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 current values. - Attributes: - Artists used to plot the object. - The sympy body, which is being plotted. - Child objects in the plot hierarchy. - The reference frame with respect to which the object is oriented. - Name of the plot object. - PlotFrame used for plotting the reference frame of the body. - PlotPoint used for plotting the center of mass of the body. - The absolute origin with respect to which the object is positioned. - List of evaluated values for the object's variables. - If the object is be visible in the plot. - 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 ( - expressionor- tupleof- 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. 
 - 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) None¶
- Plot the associated plot objects. 
 - 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. 
 
- 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 | None = 'default', **kwargs: object)¶
- 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.Pointor- sympy.physics.vector.vector.Vector, optional) – The origin of the frame with respect to the- zero_point. If a- sympy.physics.vector.vector.Vectoris 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. - Return a tuple of the necessary expressions for plotting. - 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 current values. - Attributes: - Artists used to plot the object. - Child objects in the plot hierarchy. - The sympy ReferenceFrame, which is being plotted. - The reference frame with respect to which the object is oriented. - Name of the plot object. - The origin of the object with respect to the zero_point. - The absolute origin with respect to which the object is positioned. - List of evaluated values for the object's variables. - The PlotVectors used to plot the reference frame. - If the object is be visible in the plot. - PlotVector used for the unit vector in the x direction. - PlotVector used for the unit vector in the y direction. - PlotVector used for the unit vector in the z direction. - 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 ( - expressionor- tupleof- expressions) – Args used to update the artist in the form of expressions.
 
 
 - property artists: tuple[ArtistBase, ...]¶
- Artists used to plot the object. 
 - 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) None¶
- Plot the associated plot objects. 
 - 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 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 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: ReferenceFrame, zero_point: Point, line: Iterable[Point], name: str | None = None, **kwargs: object)¶
- 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 ( - listof- sympy.physics.vector.point.Pointor- 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- originwill 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. - Return a tuple of the necessary expressions for plotting. - 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 current values. - Attributes: - Artists used to plot the object. - Child objects in the plot hierarchy. - The reference frame with respect to which the object is oriented. - The points that spawn the line. - Coordinate values of the plotted line. - Name of the plot object. - The absolute origin with respect to which the object is positioned. - List of evaluated values for the object's variables. - If the object is be visible in the plot. - 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 ( - expressionor- tupleof- expressions) – Args used to update the artist in the form of expressions.
 
 
 - property artists: tuple[ArtistBase, ...]¶
- Artists used to plot the object. 
 - 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 name: str¶
- Name of the plot object. Default is the name of the object being plotted. 
 - plot(view: gl.GLViewWidget) None¶
- Plot the associated plot objects. 
 - 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. 
 
- 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: object)¶
- 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.Pointor- 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- originwill 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. - Return a tuple of the necessary expressions for plotting. - Get coordinate of the point as expressions. - plot(view)- Plot the associated plot objects. - update()- Update the objects on the scene, based on the current values. - Attributes: - Artists used to plot the object. - Child objects in the plot hierarchy. - The reference frame with respect to which the object is oriented. - Name of the plot object. - The sympy Point, which is being plotted. - Coordinate values of the plotted point. - The absolute origin with respect to which the object is positioned. - List of evaluated values for the object's variables. - If the object is be visible in the plot. - 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 ( - expressionor- tupleof- expressions) – Args used to update the artist in the form of expressions.
 
 
 - property artists: tuple[ArtistBase, ...]¶
- Artists used to plot the object. 
 - get_expressions_to_evaluate() tuple¶
- Return a tuple of the necessary expressions for plotting. 
 - 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) None¶
- Plot the associated plot objects. 
 - property point: sympy.physics.vector.point.Point¶
- The sympy Point, which is being plotted. 
 - 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. 
 
- class symmeplot.pyqtgraph.plot_objects.PlotVector(inertial_frame: ReferenceFrame, zero_point: Point, vector: Vector, origin: Point | Vector | None = None, name: str | None = None, **kwargs: object)¶
- Bases: - PlotVectorMixin,- PgPlotBase- A class for plotting a Vector 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.
- vector ( - sympy.physics.vector.vector.Vector) – The vector that should be plotted with respect to the- zero_point.
- origin ( - sympy.physics.vector.point.Pointor- sympy.physics.vector.vector.Vector, optional) – The origin of the vector with respect to the- zero_point. If a- sympy.physics.vector.vector.Vectoris provided the- originis at the tip of the vector with respect to the- zero_point. Default is- zero_point.
- name ( - str) – Name of the plot object. Default is the vector as string.
- **kwargs ( - dict, optional) – Kwargs that are parsed to- pyqtgraph.opengl.items.GLLinePlotItem, so- color=(1, 0, 0, 1)will make the plotted vector red.
 
 - Methods: - add_artist(artist, exprs)- Add an artist to the plot object. - Return a tuple of the necessary expressions for plotting. - 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 current values. - Attributes: - Artists used to plot the object. - Child objects in the plot hierarchy. - The reference frame with respect to which the object is oriented. - Name of the plot object. - The origin of the object with respect to the zero_point. - Coordinate values of the origin of the plotted vector. - The absolute origin with respect to which the object is positioned. - List of evaluated values for the object's variables. - The sympy Vector, which is being plotted. - Values of the plotted vector. - If the object is be visible in the plot. - 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 ( - expressionor- tupleof- expressions) – Args used to update the artist in the form of expressions.
 
 
 - property artists: tuple[ArtistBase, ...]¶
- Artists used to plot the object. 
 - 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. 
 - plot(view: gl.GLViewWidget) None¶
- Plot the associated plot objects. 
 - 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 vector: sympy.physics.vector.vector.Vector¶
- The sympy Vector, which is being plotted. 
 - 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.