Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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*)]

share|improve this question
    
The argument of Cos, ArcTan etc. is assumed to be in radians, multiply by Degree to convert from degrees. –  VLC Feb 22 '13 at 13:49
    
Well, the help on PolarPlot[] states "Use ContourPlot and RegionPlot for implicit curves and regions:" –  belisarius Feb 22 '13 at 14:13
    
@VLC:Thank's for that! I didn't know it!!! –  Thanos Feb 22 '13 at 14:16
    
@belisarius: I've seen, but I would like to plot this two variable function in the most efficient way...and I am not sure on how to do it without polar plot... –  Thanos Feb 22 '13 at 14:58
    
Well, I just posted an answer :) –  belisarius Feb 22 '13 at 14:59

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer
    
I believe the first plot should be fine!!! Thank you! –  Thanos Feb 22 '13 at 15:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.