I have a function $f:\mathbb{C}\rightarrow\mathbb{C}$ which I would like to visualize by by plotting $|f|$ with Plot3D
using $\operatorname{Arg}f$ as the ColorFunction
.
I use
DensityPlot[Arg[f[a + I b]], {a, -5, 5}, {b, -5, 5}, PlotPoints -> 35,
WorkingPrecision -> 50, ColorFunction -> "DarkRainbow"]
and get the following:
which looks pretty nice. However then when I use
Plot3D[Abs[f[a + I b]], {a, -5, 5}, {b, -5, 5}, PlotPoints -> 35,
WorkingPrecision -> 50,
ColorFunction -> (ColorData[{"DarkRainbow", {-\[Pi], \[Pi]}}][Arg[f[#1 + I #2]]] &),
ColorFunctionScaling -> False,
PerformanceGoal -> "Quality", Mesh -> None]
I get
The quality of $\operatorname{Arg}f$ was fine in the DensityPlot using the same quality parameters, but it's awful when I make it a ColorFunction
. I suppose this is because the surface mesh is made from $|f|$ in the Plot3D
and not from $\operatorname{Arg}f$ as it was in the DensityPlot
, and $|f|$ isn't changing very much around the important parts of $\operatorname{Arg}f$ which is why it looks so choppy and noticable.
So, how do I fix this? Is there a way to give the ColorFunction
more PlotPoints
than the actual surface, or perhaps a different mesh? If possible I want to avoid just increasing PlotPoints
for the overall plot, as I am happy with the quality of $|f|$ here, and it can be very slow to render as it is.
f[z_] := BesselI[0, 2 Sqrt[z]]/(1 - z)
, but I plan to do this with a lot of functions so I am really interested in a general method. $\endgroup$