Solution (source code)

= Solution

Let $\psi=\lambda_d-\lambda_p$ be azimuth in the frame rotating with the planet, with the planet fixed at $\psi=0$. Since $n_d/n_p=4/5$, one synodic circuit contains four radial oscillations. To first order in $e_d$, choosing conjunction at <apoapsis> gives
$$
M_d=\pi-4\psi,
\qquad
\boxed{r(\psi)\simeq a_d[1+e_d\cos(4\psi)]}.
$$
The requested sketch is therefore a four-lobed closed curve centred on the star. For $e_d=0.2$, its radii range from $0.8a_d$ to $1.2a_d$; an outer lobe points along the star-planet line, and the planet lies at $(a_p,0)$. At that radial alignment $\phi=\pi$, because $\lambda_d=\lambda_p$ and $\lambda_d=\varpi_d+\pi$ at apoapsis.