Suppose I have this equation:
$$ z^2 + 3z + (x^2 + y^2) = 0 $$
I want the real and complex contour plot of $z(x,y)$. Analytically, the real/imaginary boundary is separated by condition $x^2 + y^2 \leq \frac{9}{4}$
The regular contour plot only plots the real parts when I use findRoot:
eqn[x_, y_, z_] := z^2 + 3 z + x^2 + y^2 == 0
ContourPlot[
z /. FindRoot[eqn[x, y, z], {z, 1}], {x, 0, 2}, {y, 0, 2},
PlotLegends -> Automatic]
The darkest purple represents the complex area.
How do I obtain contour plots of real roots of z, imaginary roots of z? Also, if possible combine them into a single graph.
Tried this different approach of letting $z = a + bi$, but doesn't work.
z = a + b I;
eqn[x_, y_, z_] := z^2 + 3 z + x^2 + y^2 == 0
ContourPlot[
z /. FindRoot[Im[eqn[x, y, z]], {b, 1}], {x, 0, 2}, {y, 0, 2},
PlotLegends -> Automatic]
Plots from difficult problem: First one is real, second one is imaginary root contour plot.