[Mathematica]複素関数の絶対値を値に、偏角の象限を色にしてプロット
ComplexPlot[func_, xrange_, yrange_] :=
Plot3D[Abs@func[x+Iy], {x, xrange[[1]], xrange[[2]]},
{y, yrange[[1]], yrange[[2]]}, PlotPoints->100,
ColorFunctionScaling->False,
ColorFunction->Function[{x, y, z},
Piecewise@MapThread[{#1, Arg@func[x+Iy]<=#2}&,
{{Red, Yellow, Blue, Green}, {-Pi/2, 0, Pi/2, Pi}}]]]