Please be patient, this is a bit complex. I encountered some weird things when trying to answer this nice question. Start with the MWE
\documentclass[tikz,border=3.14mm]{standalone}
%\usetikzlibrary{intersections}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepgfplotslibrary{fillbetween}
\begin{document}
\begin{tikzpicture}
\begin{axis}[axis equal]
\addplot[thick,samples=80,name path global=duck] {(-3)*x/abs(x)^(2/3)}; % From https://tex.stackexchange.com/a/144463/152550
\addplot[thick,samples=80,name path global=koala] ({sqrt(16/3)*cos((x) r)}, {sqrt(16)*sin((x) r)});
\path (0,0) coordinate (O) (1,0) coordinate(X);
\fill[red,name intersections={of=duck and koala,by={i1,i2}}]
(i1) circle (2pt) (i2) circle (2pt);
\end{axis}
\end{tikzpicture}
\end{document}
So far so good. However, if one activates \usetikzlibrary{intersections}
and deactivates \usepgfplotslibrary{fillbetween}
by just moving the %
down, one receives the error
! Package pgf Error: No shape named intersection-2 is known.
that tells us that the second intersection cannot be found. If we stick with this, but comment out [axis equal]
, the error disappears, i.e. the second interaction is found. What's going on here?
Even more, if one moves the determination of the intersections out of the axis environment,
\documentclass[tikz,border=3.14mm]{standalone}
%\usetikzlibrary{intersections}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepgfplotslibrary{fillbetween}
\begin{document}
\begin{tikzpicture}
\begin{axis}[axis equal]
\addplot[thick,samples=80,name path global=duck] {(-3)*x/abs(x)^(2/3)}; % From https://tex.stackexchange.com/a/144463/152550
\addplot[thick,samples=80,name path global=koala] ({sqrt(16/3)*cos((x) r)}, {sqrt(16)*sin((x) r)});
\path (0,0) coordinate (O) (1,0) coordinate(X);
\end{axis}
\fill[red,name intersections={of=duck and koala,by={i1,i2}}]
(i1) circle (2pt) (i2) circle (2pt);
\end{tikzpicture}
\end{document}
one gets
meaning that the intersections are not correct. On the other hand, it has been a common practice to compute the intersections outside the axis, see e.g. this nice answer. Notice that even if one drops axis equal
in the last example the intersections are still incorrect.