Core module

This module contains the basic classes for plottings in 2-dimensions and 3-dimensions:

digraph {
   "poliastro.plotting.core" -> "OrbitPlotter3D", "OrbitPlotter2D" ;
}

Plotting utilities.

class poliastro.plotting.core.OrbitPlotter3D(figure=None, dark=False, *, num_points=150, plane=None)

OrbitPlotter3D class.

plot(orbit, *, label=None, color=None, trail=False)

Plots state and osculating orbit in their plane.

Parameters
  • orbit (Orbit) – Orbit to plot.

  • label (string, optional) – Label of the orbit.

  • color (string, optional) – Color of the line and the position.

  • trail (bool, optional) – Fade the orbit trail, default to False.

set_view(elev, azim, distance=<Quantity 5. km>)

Changes 3D view.

class poliastro.plotting.core.OrbitPlotter2D(figure=None, *, num_points=150, plane=None)

OrbitPlotter2D class.

New in version 0.9.0.

plot_trajectory(coordinates, *, label=None, color=None, trail=False)

Plots a precomputed trajectory.

An attractor must be set first.

Parameters
  • coordinates (CartesianRepresentation) – Trajectory to plot.

  • label (string, optional) – Label of the trajectory.

  • color (string, optional) – Color of the trajectory.

  • trail (bool, optional) – Fade the orbit trail, default to False.

plot(orbit, *, label=None, color=None, trail=False)

Plots state and osculating orbit in their plane.

Parameters
  • orbit (Orbit) – Orbit to plot.

  • label (string, optional) – Label of the orbit.

  • color (string, optional) – Color of the line and the position.

  • trail (bool, optional) – Fade the orbit trail, default to False.

plot_body_orbit(body, epoch, plane=<Planes.EARTH_ECLIPTIC: 'Earth mean Ecliptic and Equinox of epoch (J2000.0)'>, *, label=None, color=None, trail=False)

Plots complete revolution of body and current position.

Parameters
  • body (poliastro.bodies.SolarSystemPlanet) – Body.

  • epoch (astropy.time.Time) – Epoch of current position.

  • plane (Planes) – Reference plane.

  • label (str, optional) – Label of the orbit, default to the name of the body.

  • color (string, optional) – Color of the line and the position.

  • trail (bool, optional) – Fade the orbit trail, default to False.