boinor.plotting.orbit.backends.matplotlib ========================================= .. py:module:: boinor.plotting.orbit.backends.matplotlib .. autoapi-nested-parse:: A module implementing orbit plotter backends based on Matplotlib. Classes ------- .. autoapisummary:: boinor.plotting.orbit.backends.matplotlib.Matplotlib2D Module Contents --------------- .. py:class:: Matplotlib2D(ax=None, use_dark_theme=False, width=None, height=None) Bases: :py:obj:`boinor.plotting.orbit.backends._base.OrbitPlotterBackend` An orbit plotter backend class based on Matplotlib. .. py:property:: ax The matplotlib axes were the scene is rendered. :returns: **ax** -- The matplotlib Axes representing the scene. :rtype: ~matplotlib.axes.Axes .. py:method:: draw_marker(position, *, color, label, marker_symbol, size) Draw a marker into the scene. :param position: A list containing the x and y coordinates of the point. :type position: list[float, float] :param color: A string representing the hexadecimal color for the point. :type color: str :param label: The name to be used in the legend for the marker. :type label: str :param marker_symbol: The marker symbol to be used when drawing the point. :type marker_symbol: str :param size: Desired size for the marker. :type size: float :returns: An object representing the trace of the marker in the scene. :rtype: ~matplotlib.lines.Line2D .. py:method:: draw_position(position, *, color, label, size) Draw the position of a body in the scene. :param position: A list containing the x, y and z coordinates of the point. :type position: list[float, float, float] :param color: A string representing the hexadecimal color for the marker. :type color: str :param label: The name to be used to identify the position in the legend of the figure. :type label: str :param size: The size of the marker. :type size: float :returns: An object representing the trace of the coordinates in the scene. :rtype: ~matplotlib.lines.Line2D .. py:method:: draw_impulse(position, *, color, label, size) Draw an impulse into the scene. :param position: A list containing the x and y coordinates of the impulse location. :type position: list[float, float] :param color: A string representing the hexadecimal color for the impulse marker. :type color: str :param label: The name to be used to identify the position in the legend of the figure. :type label: str :param size: The size of the marker for the impulse. :type size: float :returns: An object representing the trace of the impulse in the scene. :rtype: ~matplotlib.lines.Line2D .. py:method:: draw_sphere(position, *, color, label, radius) Draw an sphere into the scene. :param position: A list containing the x and y coordinates of the sphere location. :type position: list[float, float] :param color: A string representing the hexadecimal color for the sphere. :type color: str :param label: The name shown in the legend of the figure to identify the sphere. :type label: str :param radius: The radius of the sphere. :type radius: float :returns: An object representing the trace of the sphere in the scene. :rtype: ~matplotlib.patches.Patch .. py:method:: undraw_attractor() Remove the attractor from the scene. .. py:method:: draw_axes_labels_with_length_scale_units(length_scale_units) Draw the desired label into the specified axis. :param lenght_scale_units: Desired units of lenght used for representing distances. :type lenght_scale_units: ~astropy.units.Unit .. py:method:: draw_coordinates(coordinates, *, colors, dashed, label) Draw desired coordinates into the scene. :param coordinates: A set of lists containing the x, y and z coordinates. :type coordinates: list[list[float, float, float]] :param colors: A list of string representing the hexadecimal color for the coordinates. :type colors: list[str] :param dashed: Whether to use a dashed or solid line style for the coordiantes. :type dashed: bool :param label: The name to be used to identify the coordinates in the legend of the figure. :type label: str :returns: **trace_coordinates** -- An object representing the trace of the coordinates in the scene. :rtype: ~matplotlib.lines.Line2D .. py:method:: generate_labels(label, has_coordinates, has_position) Generate the labels for coordinates and position. :param label: A string representing the label. :type label: str :param has_coordinates: Whether the object has coordinates to plot or not. :type has_coordinates: boolean :param has_position: Whether the object has a position to plot or not. :type has_position: boolean :returns: A tuple containing the coordinates and position labels. :rtype: tuple .. py:method:: update_legend() Update the legend of the scene. .. py:method:: resize_limits() Resize the limits of the scene. .. py:method:: show() Display the scene. .. py:property:: scene Return the scene object. .. py:property:: name Return the name of the backend. :returns: Name of the backend. :rtype: str .. py:property:: is_2D Assert if backend is 2D. :returns: ``True`` if it is a 2D backend, ``False`` if it is not. :rtype: bool .. py:property:: is_3D Assert if backend is 3D. :returns: ``True`` if it is a 3D backend, ``False`` if it is not. :rtype: bool