# Buggy code
def plot_ephem(self, ephem, epoch=None, *, label=None, color=None, trail=False):
    """Plots Ephem object over its sampling period.

    Parameters
    ----------
    ephem : ~poliastro.ephem.Ephem
        Ephemerides to plot.
    epoch : astropy.time.Time, optional
        Epoch of the current position, none will be used if not given.
    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.

    """
    super().plot_ephem(ephem, epoch, label=label, color=color, trail=trail)

    if not self._figure._in_batch_mode:
        return self.show()


# Traceback (TypeError)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-130-a5728741413f> in <module>
2
3 plotter.set_attractor(Sun)
----> 4 plotter.plot_ephem(earth)

~/.pyenv/versions/seminar38/lib/python3.8/site-packages/poliastro/plotting/core.py in plot_ephem(self, ephem, epoch, label, color, trail)
118
119         """
--> 120         super().plot_ephem(ephem, epoch, label=label, color=color, trail=trail)
121
122         if not self._figure._in_batch_mode:

~/.pyenv/versions/seminar38/lib/python3.8/site-packages/poliastro/plotting/_base.py in plot_ephem(self, ephem, epoch, label, color, trail)
286         # Do not return the result of self._plot
287         # This behavior might be overriden by subclasses
--> 288         self._plot_ephem(ephem, epoch, label=label, color=color, trail=trail)
289
290

~/.pyenv/versions/seminar38/lib/python3.8/site-packages/poliastro/plotting/_base.py in _plot_ephem(self, ephem, epoch, label, color, trail)
200             r0 = None
201
--> 202         return self.__add_trajectory(
203             coordinates, r0, label=str(label), colors=colors, dashed=False
204         )

~/.pyenv/versions/seminar38/lib/python3.8/site-packages/poliastro/plotting/_base.py in __add_trajectory(self, coordinates, position, label, colors, dashed)
119         self._trajectories.append(trajectory)
120
--> 121         self._redraw_attractor()
122
123         trace_coordinates, trace_position = self.__plot_coordinates_and_position(

~/.pyenv/versions/seminar38/lib/python3.8/site-packages/poliastro/plotting/_base.py in _redraw_attractor(self)
77         self._clear_attractor()
78
---> 79         self._draw_sphere(
80             self._attractor_radius, color, self._attractor.name,
81         )

~/.pyenv/versions/seminar38/lib/python3.8/site-packages/poliastro/plotting/core.py in _draw_sphere(self, radius, color, name, center)
275
276     def _draw_sphere(self, radius, color, name, center=[0, 0, 0] * u.km):
--> 277         x_center, y_center = self._project(
278             center[None]
279         )  # Indexing trick to add one extra dimension

~/.pyenv/versions/seminar38/lib/python3.8/site-packages/poliastro/plotting/_base.py in _project(self, rr)
296
297     def _project(self, rr):
--> 298         rr_proj = rr - rr.dot(self._frame[2])[:, None] * self._frame[2]
299         x = rr_proj.dot(self._frame[0])
300         y = rr_proj.dot(self._frame[1])

TypeError: 'NoneType' object is not subscriptable

# Fixed code
def plot_ephem(self, ephem, epoch=None, *, label=None, color=None, trail=False):
    """Plots Ephem object over its sampling period.

    Parameters
    ----------
    ephem : ~poliastro.ephem.Ephem
        Ephemerides to plot.
    epoch : astropy.time.Time, optional
        Epoch of the current position, none will be used if not given.
    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.

    """
    if self._frame is None:
        raise ValueError(
            "A frame must be set up first, please use "
            "set_orbit_frame(orbit) or plot(orbit)"
        )
    super().plot_ephem(ephem, epoch, label=label, color=color, trail=trail)