Visualizing the SpaceX Tesla Roadster trip to Mars

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

from poliastro.bodies import Earth, Mars, Sun
from poliastro.ephem import Ephem
from poliastro.frames import Planes
from poliastro.plotting import OrbitPlotter3D
from poliastro.util import time_range

EPOCH = Time("2018-02-18 12:00:00", scale="tdb")
# More info:
import as pio

pio.renderers.default = "plotly_mimetype+notebook_connected"
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 poliastro.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 0x7f318c60a8e0>],
 <matplotlib.lines.Line2D at 0x7f318b257730>)
frame = OrbitPlotter3D(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 *