- class bgplot.features.graphics.graphics.Graphics(size: int = 200)
the ~.Graphics class includes the graphical representation of all the bgplot’s entities
- add_axes(axes: Axes, position: Point = Point(0.0, 0.0, 0.0), length: float = 0.1) None
adds axes to be displayed
- Parameters:
- axes~.entities.axes.Axes
the axes to be displayed
- position~.entities.point.Point, optional
the position of the axes. By default on the origin
- lengthfloat, optional
the length of the displayed axes. 0.1 by default
See also
add_multiple_axesadds multiple axes to be displayed
- add_line(line: Line, line_range: tuple[float, float] = (-0.5, 0.5), style: str = '-', color: str = '#4d5359', width: float = 1.0) None
adds a line to be displayed
- Parameters:
- line~.entities.line.Line
the line to be displayed
- line_rangetuple[float, float], optional
the range of the line to be plotted. From -0.5 to 0.5 by default
- stylestr, optional
the style of the line. Follows the matplotlib’s style code. ‘-’ by default
- colorstr, optional
the color of the displayed line. Follows the matplotlib’s color code. ~.Colors.black by default
- widthfloat, optional
the width of the displayed line. 1.0 by default
See also
add_linesadds multiple lines to be displayed
- add_lines(lines: list[bgplot.entities.line.Line], line_range: tuple[float, float] = (-0.5, 0.5), style: str = '-', color: str = '#4d5359', width: float = 1.0) None
adds multiple lines to be displayed
- Parameters:
- lineslist[~.entities.line.Line]
the list of lines to be displayed
- line_rangetuple[float], optional
the range of the lines to be plotted. From -2.0 to 2.0 by default
- stylestr, optional
the style of the lines. Follows the matplotlib’s style code. ‘-’ by default
- colorstr, optional
the color of the displayed lines. Follows the matplotlib’s color code. ~.Colors.black by default
- widthfloat, optional
the width of the displayed lines. 1.0 by default
See also
add_lineadds line to be displayed
- add_multiple_axes(axes_list: list[bgplot.entities.axes.Axes], positions: list[bgplot.entities.point.Point] | None = None, length: float = 0.1) None
adds multiple axes to be displayed
- Parameters:
- axes_listlist[~.entities.axes.Axes]
the list of axes to be displayed
- positionslist[~.entities.point.Point], optional
the positions of the axes. By default on the origin
- lengthfloat, optional
the length of the plotted axes. 0.1 by default
- Raises:
- IndexError
if the lengths of the axes list and positions do not match
See also
add_axesadds axes to be displayed
- add_oriented_point(oriented_point: OrientedPoint, length: float = 0.1, color: str = '#4d5359') None
adds a point with orientation to be displayed
- Parameters:
- oriented_point~.entities.oriented_point.OrientedPoint
the point to be added
- lengthfloat, optional
the length of the displayed axes. 0.1 by default
- colorstr, optional
the color of the point. ~.Colors.black by default
See also
add_pointadds a point to be displayed
add_pointsadds multiple points to be displayed
add_oriented_pointsadds multiple points with orientation to be displayed
Notes
the color of the axes are given by the standard x-red, y-green, z-blue
- add_oriented_points(oriented_points: list[bgplot.entities.oriented_point.OrientedPoint], style: str = 'o', length: float = 0.1, color: str = '#4d5359', width: float = 1.0) None
adds multiple points with orientation to be displayed
- Parameters:
- oriented_pointslist[~.entities.oriented_point.OrientedPoint]
the oriented points to be added
- stylestr, optional
the line style of the connection of points. Follows the matplotlib’s style code. ‘o’ by default
- lengthfloat, optional
the length of the displayed axes. 0.1 by default
- colorstr, optional
the color of the points. ~.Colors.black by default
- widthfloat, optional
the width of the displayed line. 1.0 by default
See also
add_pointadds a point to be displayed
add_pointsadds multiple points to be displayed
add_oriented_pointadds a point with orientation to be displayed
Notes
the color of the axes are given by the standard x-red, y-green, z-blue
- add_plane(plane: Plane, center: Point = Point(0.0, 0.0, 0.0), size: float = 0.2, alpha: float = 0.5, color: str = '#aecdd2') None
adds plane to be displayed
- Parameters:
- plane~.entities.plane.Plane
the plane to be displayed
- center~.entities.point.Point, optional
the center point of the plane. By default on the origin
- sizefloat, optional
the size of the plane. 0.2 by default
- alphafloat, optional
the opacity value. 0.5 by default
- colorstr, optional
the color of the plane. ~.Colors.blue by default
See also
add_planesadds multiple planes to be displayed
- add_planes(planes: list[bgplot.entities.plane.Plane], centers: list[bgplot.entities.point.Point] | None = None, size: float = 0.2, alpha: float = 0.5, color: str = '#aecdd2') None
adds multiple planes to be displayed
- Parameters:
- planeslist[~.entities.plane.Plane]
the list of planes to be displayed
- centerslist[~.entities.point.Point], optional
the list of the center of each plane. By default on the origin
- sizefloat, optional
the sizes of the planes. 0.2 by default
- alphafloat, optional
the opacity value. 0.5 by default
- colorstr, optional
the color of the planes. ~.Colors.blue by default
- Raises:
- IndexError
if the lengths of the plane and center list do not match
See also
add_planeadds plane to be displayed
- add_point(point: Point, color: str = '#4d5359') None
adds a point to be displayed
- Parameters:
- point~.entities.point.Point
the point to be added
- colorstr, optional
the color of the point. Uses the same notation as matplotlib’s color code. ~.Colors.black by default
See also
add_pointsadds multiple points to be displayed
add_oriented_pointadds a point with orientation to be displayed
add_oriented_pointsadds multiple points with orientation to be displayed
- add_points(points: list[bgplot.entities.point.Point], style: str = 'o', color: str = '#4d5359', width: float = 1.0) None
adds multiple points to be displayed
- Parameters:
- pointslist[~.entities.point.Point]
the list of points to be added
- stylestr, optional
the style of the line that joins the points. Uses the same notation as matplotlib’s style code. ‘o’ by default
- colorstr, optional
the color of the points. Uses the same notation as matplotlib’s color code. ~.Colors.black by default
- widthfloat, optional
the width of the displayed line. 1.0 by default
See also
add_pointadds a point to be displayed
add_oriented_pointadds a point with orientation to be displayed
add_oriented_pointsadds multiple points with orientation to be displayed
- add_vector(vector: Vector, position: Point = Point(0.0, 0.0, 0.0), length: float = 0.1, color: str = '#4d5359') None
add a vector to be displayed
- Parameters:
- vector~.entities.vector.Vector
the vector to be displayed
- position~.entities.point.Point, optional
the position of the vector. On the origin by default
- lengthfloat, optional
the length of the displayed vector. 0.1 by default
- colorstr, optional
the color of the plotted vector. ‘~.Colors.black by default.
- Notes
- —–
- currently, the color of the vector does not support the matplotlib’s color code due to the implementation
See also
add_vectorsadd multiple vectors to be displayed
- add_vectors(vectors: list[bgplot.entities.vector.Vector], positions: list[bgplot.entities.point.Point] | None = None, length: float = 0.1, color: str = '#4d5359') None
add multiple vectors to be displayed
- Parameters:
- vectorslist[~.entities.vector.Vector]
vectors to be added
- positionslist[~.entities.point.Point], optional
list of positions of each vector. By default on the origin
- lengthfloat, optional
the length of the displayed vectors. 0.1 by default
- colorstr, optional
the color of the plotted vector. ~.Colors.black by default.
- Raises:
- IndexError
if the lengths of the vector and position list do not match
See also
add_vectoradd a vector to be displayed
Notes
currently, the color of the vector does not support the matplotlib’s color code due to the implementation
- clear() None
Description
- Parameters:
- arg1type
description
See also
functiondescription
- close() None
closes the figure window
- disable(*disable_inputs) None
disables plot elements as grid, background, ticks, axes…
- Parameters:
- disable_inputstuple[str]
- possible values:
‘ticks’ for all ticks
‘xticks’ for xticks
‘yticks’ for yticks
‘zticks’ for zticks
‘axes’ for all axes
‘xaxis’ for the x axis
‘yaxis’ for the y axis
‘zaxis’ for the z axis
‘grid’ for the grid
‘background’ for the complete background
‘walls’ for the sides of the background
‘floor’ for the background floor
- set_background_color(color: str, part: str = '') None
sets the background color
- Parameters:
- colorstr
the color of the background. Supports hex values but not matplotlib’s standard codes
- partstr, optional
the parts of the background to be colored. Use ‘walls’ for the walls and ‘floor’ for the floor
- set_limits(xlim: tuple[float, float], ylim: tuple[float, float], zlim: tuple[float, float], lock_aspect_ratio: bool = True) None
sets the limits of each axis of the figure
- Parameters:
- xlimtuple[float, float]
the limits of the x axis
- ylimtuple[float, float]
the limits of the y axis
- zlimtuple[float, float]
the limits of the z axis
- lock_aspect_ratiobool, optional
locks the aspect ratio of the figure so the length of all axes are consistent. True by default
- set_title(title: str) None
sets the title for the next figures
- Parameters:
- titlestr
the title to be set
- set_view(azimut: float, elevation: float) None
sets the viewing angle given the azimut and the elevation