Does anyone have a code for drawing tropical amoebas? For example for the polynomial $$P(z,w) = 50z^3 + 83z^2w + 24zw^2 + w^3 + 392z^2 + 414zw + 50w^2 - 28z + 59w - 100$$ it has a form
(The picture is taken from mathoverflow.)
One of the possible approaches is implemented here, but pictures are not very sharp.
EDT Greg Hurst gave in the comments a good code which works nicely for the curve mentioned above. It works good in other examples, but something goes wrong for the simple curve $1 + x_1 + x_2 - 4 x_1 x_2 + x_1^2 x_2^2=0$:
A picture generated by amoebas.ru
The code given by Greg Hurst:
poly[x1_, x2_] := 1 + x1 + x2 - 4 x1 x2 + x2^2 x1^2;
Clear[try1x, try2x];
{try1x[b_, \[Theta]_], try2x[b_, \[Theta]_]} =
Thread[{Log[Abs[SolveValues[poly[z, w] == 0, z]]] /.
w -> Exp[b + I \[Theta]], b}];
Clear[try1y, try2y];
{try1y[a_, \[Theta]_], try2y[a_, \[Theta]_]} =
Thread[{a,
Log[Abs[SolveValues[poly[z, w] == 0, w]]] /.
z -> Exp[a + I \[Theta]]}];
showx = ParallelMap[
ParametricPlot[#, {\[Theta], 0, 2 \[Pi]}, PlotPoints -> 500,
MaxRecursion -> 0] &,
Join @@ Table[{try1x[b, \[Theta]], try2x[b, \[Theta]]}, {b, -4,
6, .01}]]; // AbsoluteTiming
showy = ParallelMap[
ParametricPlot[#, {\[Theta], 0, 2 \[Pi]}, PlotPoints -> 500,
MaxRecursion -> 0] &,
Join @@ Table[{try1y[a, \[Theta]], try2y[a, \[Theta]]}, {a, -4,
6, .01}]]; // AbsoluteTiming
plot = Show[showx, showy, PlotRangePadding -> None,
PlotRange -> {{-4, 6}, {-4, 6}}] /. {Line[{a_, ___, b_}] :>
Line[{a, b}]}
im = Rasterize[Show[plot, Axes -> False], RasterSize -> 720];
ImageMesh[ColorNegate[im], DataRange -> {{-4, 6}, {-4, 6}}]



poly[z_, w_] := 50*z^3 + 83*z^2*w + 24*z*w^2 + w^3 + 392*z^2 + 414*z*w + 50*w^2 - 28*z + 59*w - 100; solnzlogs[w_?NumberQ] := Thread[{Log[Abs[NSolveValues[poly[z, w] == 0, z]]], Log[Abs[w]]}] bnd = 20.; skip = .01; AbsoluteTiming[ pts = Flatten[Table[solnzlogs[x + I*y], {x, -bnd, bnd, skip}, {y, -bnd, bnd, skip}], 2];] ListPlot[pts, PlotRange -> All]I expect this to not come back very soon though. $\endgroup$