I have a function $Z(r, \theta)$ that I would like to plot over the unit disk. I could of course plot it as $Z(\sqrt{x^2+y^2}, \arctan(y/x))$, but the best I can do with this is a square plot. I would like a plot defined from $0 How can I make Mathematica generate a plot like this? Thank you!
Answer
Here's my attempt to plot the Zernike functions on the unit disk:
ZernikeZ[n_Integer, m_Integer, r_, θ_] /; -n <= m <= n :=
If[m < 0, Sin[m θ], Cos[m θ]] ZernikeR[n, m, r]
Table[DensityPlot[ZernikeZ[n, m, Norm[{x, y}], ArcTan[x, y]], {x, y} ∈ Disk[],
ColorFunction -> (ColorData[{"ThermometerColors", "Reverse"},
LogisticSigmoid[2 #]] &),
ColorFunctionScaling -> False, Frame -> False,
PlotPoints -> 55],
{n, 0, 4}, {m, -n, n, 2}] // GraphicsGrid
Comments
Post a Comment