Visualizing the SpaceX Tesla Roadster trip to Mars

from astropy.time import Time
from astropy import units as u

from hapsira.bodies import Earth, Mars, Sun
from hapsira.ephem import Ephem
from hapsira.frames import Planes
from hapsira.plotting import OrbitPlotter
from hapsira.plotting.orbit.backends import Plotly3D
from hapsira.util import time_range

EPOCH = Time("2018-02-18 12:00:00", scale="tdb")
roadster = Ephem.from_horizons(
    "SpaceX Roadster",
    epochs=time_range(EPOCH, end=EPOCH + 360 *,
WARNING: AstropyDeprecationWarning: ``id_type``s 'majorbody' and 'id' are deprecated and replaced with ``None``, which has the same functionality. [astroquery.jplhorizons.core]
Ephemerides at 50 epochs from 2018-02-18 12:00:00.000 (TDB) to 2019-02-13 12:00:00.000 (TDB)
from hapsira.plotting.misc import plot_solar_system
frame = plot_solar_system(outer=False, epoch=EPOCH)
frame.plot_ephem(roadster, EPOCH, label="SpaceX Roadster", color="black")
(<matplotlib.lines.Line2D at 0x7fba4c46d040>,
 <matplotlib.lines.Line2D at 0x7fba4c4aae20>)
frame = OrbitPlotter(backend=Plotly3D(), plane=Planes.EARTH_ECLIPTIC)

frame.plot_body_orbit(Earth, EPOCH)
frame.plot_body_orbit(Mars, EPOCH)

frame.plot_ephem(roadster, EPOCH, label="SpaceX Roadster", color="black")

frame.set_view(45 * u.deg, -120 * u.deg, 4 *