4

I am trying to make a polar plot of a two variable function, which has a radial and an angular part. For instance Y[r,φ]=r^2 Cos[φ].

I can make this plot using ContourPlot, but is there a way to do it using PolarPLot? My ContourPlot is

Y[r_, f_] := r^2 Cos[f]
ContourPlot[Y[Sqrt[x^2 + y^2], ArcTan[x, y]], {x, 0, 1}(*Radius till 1*), {y, 0, 60}(*Angle from 0 to 60*)]

Thanos
  • 1,003
  • 1
  • 12
  • 21

1 Answers1

2

PolarPlot[] is a handicapped plotting function (it doesn't support Filling, for example). Much easier with other functions:

h[r_, f_] := r^2 Cos[f]
Quiet@Show[
        ContourPlot[h[Sqrt[x^2 + y^2], ArcTan[x, y]], {x, 0, 1}, {y, 0, 1},
                  RegionFunction -> Function[{x, y, f}, 0 < ArcTan[x, y] < Pi/3 && x^2 + y^2 < 1],
                  Contours -> 10,  AspectRatio -> 1], 
         Graphics@Circle[]]

Mathematica graphics

Another possibility:

Plot3D[h[Sqrt[x^2 + y^2], ArcTan[x, y]],
 {x, -1, 1},
 {y, -1, 1},
 AspectRatio -> 1,
 ColorFunction -> "SunsetColors",
 MeshFunctions -> {#3 &},
 Mesh -> 7,
 PlotStyle -> Directive[Specularity[White, 50], Opacity[0.8]]]

Mathematica graphics

You may even draw your Pi/3 angle on the surface:

Plot3D[h[Sqrt[x^2 + y^2], ArcTan[x, y]],
 {x, -1, 1},
 {y, -1, 1},
 AspectRatio -> 1,
 ColorFunction -> "SunsetColors",
 MeshFunctions -> {UnitBox@(ArcTan[#2, #1] - Pi/3) &},
 Mesh -> 7,
 PlotStyle -> Directive[Specularity[White, 50], Opacity[0.8]]]

Mathematica graphics

Dr. belisarius
  • 115,881
  • 13
  • 203
  • 453