# How to draw a density (list) polar plot?

I have the function $P_{ns}$ which gives me the amplitude of a signal. The angles $\theta_B$ and $\phi_B$ are known. (25 and 180 for example)

    Subscript[P, NS][θ_, ϕ_] =
Sin[θ Degree]*Sin[ϕ Degree] *
Cos[Subscript[θ, B]] -
Cos[θ Degree]*Sin[Subscript[θ, B]]*
Sin[Subscript[ϕ, B]];


This function should be plotted in a polar plot similar to: or to

But in the second case, the color of the line does not change according to the given color function based on the $P_{ns}$ function, where $r$ is $\theta$ and $t$ is $\phi$.

    PolarPlot[{10*π/180, 20*π/180, 30*π/180, 40*π/180,
50*π/180, 60*π/180}, {ϕ, 0, 2 π},
PlotStyle -> Thickness[0.02],
ColorFunction ->
Function[{x, y, r, t},
Hue[Table[Subscript[Pnew, NS][i*10, j*10], {i, 6}, {j, 36}]]],
ColorFunctionScaling -> True]

• What is $Pnew_{NS}$? Commented Mar 15, 2016 at 0:18
• The initial function is zero. That's a fundamental problem, I guess.. Commented Mar 15, 2016 at 6:30
• @Rom38 The function is 0 only for ϕ =0 and 180. Commented Mar 15, 2016 at 7:23
• @DavidG.Stork PnewNS is basically the same function after changing the coordinate system. Commented Mar 15, 2016 at 7:25

As I understood the question of the topic starter, she needs to plot the ContourPlot of the function that is defined by polar coordinates. My solution is done for very similar (but of course, nonzero function):

pns[θ_, ϕ_] := Sin[ϕ]*Cos[θ] - Cos[ϕ]*Sin[θ];

ContourPlot[
pns[Sqrt[x^2 + y^2], Arg[x + I*y]], {x, -π, π}, {y, -π, π},
PlotRange -> All, PlotPoints -> 50,
RegionFunction -> Function[{x, y}, x^2 + y^2 < 9]]


• Please insert code in a format that can be copied and evaluated as-is. I have edited your post for you this time as an example. Commented Mar 15, 2016 at 8:15
• How did you do the Greec letters in code wrappers? I was trying to do it but without success.. Commented Mar 15, 2016 at 11:40
• To make them pretty use halirutan's toolbar buttons, but if you don't it is better to leave them as e.g. \[Theta] which will copy and paste correctly. Commented Mar 15, 2016 at 11:55
• Problem is that I don't need to plot the density for all the values of θ , but only for some specific values, like 10, 20 degrees, etc.. Commented Mar 15, 2016 at 18:28
• You can to the same as I did, but first make a Table from your function like dat=Table[pns[Sqrt[x^2 + y^2], Arg[x + I*y]], {x, -π, π,step}, {y, -π, π,step}], using the step value what you need. After this you can use the ListContourPlot[dat,<options>] to plot it. Just remove the PlotPoints instruction Commented Mar 16, 2016 at 4:36