PolarDensityPlot and ListPolarDensityPlot

Selwyn Hollis
slhollis@mac.com

This loads the package, presuming it’s in AddOns : Applications.

<< PolarDensity.m

If you choose to place the package in the Graphics subdirectory, then load it by entering

<< Graphics`PolarDensity`

?PolarDensityPlot

PolarDensityPlot functions in essentially the same way as DensityPlot. As with DensityPlot the default ColorFunction is GrayLevel, but unlike DensityPlot the default value of Mesh is False.

PolarDensityPlot[
      Cos[2  r θ], {r,  .5, 2}, {θ, π/3, 
        11  π/6}]

The default value of PlotPoints is {15, (Subscript[p, θ])}, where \(TraditionalForm\`p\_θ = ⌊4 \( θ2 - θ1\)\/\(2  π\)·15⌋\).  For any specification of the form PlotPoints -> (Subscript[p, r]), the actual PlotPoints value becomes {(Subscript[p, r]), (Subscript[p, θ])}, where \(TraditionalForm\`p\_θ = ⌊4 \(\( θ2 - θ1\)\/\(2  π\)\) p\_r⌋\).

The following uses a finer grid and a few options.

PolarDensityPlot[
      Cos[2  r θ], {r,  .5, 2}, {θ, 0, 11  π/6}, 
      PlotPoints -> 30, ColorFunction -> (Hue[0, 1, #] &), 
      Frame -> False]

ListPolarDensityPlot functions in essentially the same way as ListDensityPlot.

?ListPolarDensityPlot

This generates a matrix of numbers.

polardata = 
        Table[Cos[2  π r ] Sin[3 θ], {θ, 0, 
            47  π/24, π/24}, {r,  .1, 1,  .1}];

Here is the density plot.

ListPolarDensityPlot[polardata]

This uses PlotRange to plot the same data over an annular sector. (This is not a truncation of the previous plot.)

ListPolarDensityPlot[polardata, 
      PlotRange -> {{1, 4}, {π/3, π}, Automatic}]

PolarDensityPlot[
      r Cos[3  θ] -  Sin[4  r + 5  θ], {r, 0, 6}, {θ, 
        0, 8  π/4}, PlotPoints -> 45, 
      ColorFunction -> (Hue[#, 1, #] &), 
      Frame -> False]

\(PolarDensityPlot[
      Cos[3  π\ r]\ \ Cos[\ π\ Sin[2  θ] + 1], {r, 0, 
        1}, {θ, 0, 2  π}, PlotPoints -> 30, 
      ColorFunction -> \((CMYKColor[1 -  .5  #, 1 - #\^2, #, 0] &)\), 
      Frame -> False]\)