3
$\begingroup$
PolarPlot[3 + 2 Cos[4*theta], {theta, 0, 2 Pi},
PolarAxes -> Automatic,
Axes -> False,
Frame -> False,
PolarTicks -> {Table[n*Pi/4, {n, 1, 8}], {1, 3, 5}}
]

gives

enter image description here

It does not give me the ticks for the radius, and does not look like the Ticks have all been fit too.

If I use

PolarPlot[3 + 2 Cos[4*theta], {theta, 0, 2 Pi},
    PolarAxes -> Automatic,
    PolarGridLines -> {Table[n*2 Pi/8, {n, 1, 8}], 
    Table[n, {n, 1, 5, 2}]},
    GridLinesStyle -> Directive[Gray, Dashed],
    PlotRange -> 8,
    Axes -> False,
    Frame -> False,
    PolarTicks -> {Table[n*Pi/4, {n, 1, 8}], {1, 3, 5}}
]

gives

enter image description here

Does I always to have change PlotRange -> XXX to fit it? Why aren't I getting the 1,2,3 ticks for the radius?

$\endgroup$
2
  • $\begingroup$ PlotRangeClipping -> False, PlotRangePadding -> .1 $\endgroup$
    – cvgmt
    Jun 28 at 4:05
  • $\begingroup$ @cvgmt 好久不见!!谢谢 $\endgroup$
    – CasperYC
    Jun 28 at 4:09

2 Answers 2

5
$\begingroup$

Set PlotRangeClipping -> False, PlotRangePadding -> 1.1, PolarAxes ->{True, True}.

But I still don't how to add another ticks.

PolarPlot[3 + 2 Cos[4*theta], {theta, 0, 2 Pi}, 
 PolarGridLines -> {Table[{n*2 Pi/8, Red}, {n, 1, 8}], {{1, Blue}, {3,
      Green}, {5, Cyan}}}, GridLinesStyle -> Directive[Gray, Dashed], 
 PlotRange -> 8, Axes -> False, Frame -> False, 
 PolarTicks -> {Table[n*Pi/4, {n, 1, 8}], {1, 3, 5}}, 
 PlotRangeClipping -> False, PlotRangePadding -> 1.1, 
 PolarAxes -> {True, True}]

enter image description here

$\endgroup$
4
$\begingroup$

To include minor ticks

PolarPlot[3 + 2 Cos[4*theta],
 {theta, 0, 2 Pi},
 PolarGridLines -> {
   Table[{n*2 Pi/8, Red}, {n, 1, 8}],
   {{1, Blue}, {3, Green}, {5, Cyan}}},
 GridLinesStyle ->
  Directive[AbsoluteThickness[.75], Dashed],
 PlotRange -> 8,
 PolarTicks -> {
   Join[Table[{n*Pi/4, n*Pi/4}, {n, 0, 7}],
    Table[{n*Pi/12, ""}, {n, 1, 24}]],
   Join[{#, #} & /@ {1, 3, 5, 7}, {#, ""} & /@ Range[1, 8, 1/2]]},
 PlotRangeClipping -> False,
 PlotRangePadding -> 1.1,
 PolarAxes -> {True, True},
 ImagePadding -> {{20, 20}, {30, 30}}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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