# Overlay of two functions leaves gaps

I have a function defined as:

$$\rho_{m}\left(\epsilon,m\right)=\left[-2\epsilon r\pm\left(4\epsilon^{2}r^{2}+m\lambda r^{3}\right)^{\frac{1}{2}}\right]^{\frac{1}{2}}$$

I want to plot it for some $$m\in \mathbb{Z}$$, so I wrote this code:

Clear[r,\[Lambda]];
\[Lambda]=685*10^-9;
r=25*10^-3;
\[Rho]1[\[Epsilon]_,m_]=(-2*\[Epsilon]*r+(4*\[Epsilon]^2*r^2+m*\[Lambda]*r^3)^(1/2))^(1/2);
\[Rho]2[\[Epsilon]_,m_]=(-2*\[Epsilon]*r-(4*\[Epsilon]^2*r^2+m*\[Lambda]*r^3)^(1/2))^(1/2);
M=Range[-5,5,1];
p1=Show[Plot[\[Rho]1[\[Epsilon]*10^-3,#]*10^3, {\[Epsilon],-0.5,0.5}, PlotRange -> {{-0.5,0.5},{0, 5}},AxesOrigin->{-0.5,0},PlotTheme->"Monochrome"] & /@ M];
p2=Show[Plot[\[Rho]2[\[Epsilon]*10^-3,#]*10^3, {\[Epsilon],-0.5,0.5}, PlotRange -> {{-0.5,0.5},{0, 5}},AxesOrigin->{-0.5,0},PlotTheme->"Monochrome"] & /@ M];
Show[{p1,p2}]


Which outputs: However, there are some tiny gaps where the two functiosn meet, but I was expecting them to be continuous. How can I fix that?

• Adding the option PlotPoints->1000 to both your Plots will make those gaps much less visible. – Bill Apr 26 '19 at 19:19
• I think that the problem may be that the functions become imaginary at $\epsilon = 0$. Plot doesn't plot anything at all when the value is imaginary. When it happens precisely at the point where they're supposed to meet I guess it becomes a numerical issue, hence why PlotPoints may help. – C. E. Apr 26 '19 at 19:38

If you turn the equation around and plot $$\epsilon$$ as a function of $$\rho$$, then there are no gaps and no branches:
λ = 685*10^-9; 