7
$\begingroup$

I have created a ListPolarPlot using the code below. I need to label the lines that extend from the centre to the outer ring. I do not want to label them with the values that these lines represent but rather with the values 1 to 7. I have tried LabelingFunction and some other things but these options don't work for ListPolarPlot. Can anyone help me with this ?

As a second best solution I could just label the plotted points themselves from 1 to 7 (starting at the right hand horizontal and working anticlockwise).

ListPolarPlot[
 Tooltip /@ {0.01422, 0.3425217, 0.30036, 0.013, 0.152, 0.3762, 
   0.122}, Joined -> True, 
 PlotMarkers -> Graphics@Disk[{0, 0}, Scaled[0.025]], 
 Axes -> {True, False}, PolarAxes -> Automatic, 
 PolarGridLines -> {{0.897, 0.897*2, 0.897*3, 0.897*4, 0.897*5, 
    0.897*6, 0.897*7}, {0.1, 0.2, 0.3}}, PolarTicks -> None, 
 AspectRatio -> 1/1, ImageSize -> {300, 300}]
$\endgroup$
3
$\begingroup$

This will work for any number of points:

lpp[l_List] := ListPolarPlot[Tooltip /@ l,
  Joined -> True,
  PlotMarkers -> Graphics@Disk[{0, 0}, Scaled[0.025]],
  Axes -> {True, False},
  PolarAxes -> Automatic, 
  PolarGridLines -> {Array[2 Pi #/Length@l &, Length@l], {0.1, 0.2, 0.3}}, 
  PolarTicks -> Transpose[{Array[2 Pi #/Length@l &, Length@l], RotateLeft[Range@Length@l, 1]}],
  ImageSize -> {300, 300}]

l = RandomReal[{0, .3}, 10];
lpp[l]

Mathematica graphics

$\endgroup$
3
$\begingroup$

You could replace your PolarTicks option with

PolarTicks -> Table[{(i - 1) (2 \[Pi])/7, i}, {i, 1, 7}]

or using your numerical values with

PolarTicks -> {{0.897, 2}, {0.897*2, 3}, {0.897*3, 4}, {0.897*4, 5}, {0.897*5, 6}, {0.897*6, 7}, {0.897*7, 1}}

The syntax is {position,label} for every tick.

ListPolarPlot[
Tooltip /@ {0.01422, 0.3425217, 0.30036, 0.013, 0.152, 0.3762, 
0.122}, Joined -> True, 
PlotMarkers -> Graphics@Disk[{0, 0}, Scaled[0.025]], 
Axes -> {True, False}, PolarAxes -> Automatic, 
PolarGridLines -> {{0.897, 0.897*2, 0.897*3, 0.897*4, 0.897*5, 
0.897*6, 0.897*7}, {0.1, 0.2, 0.3}}, AspectRatio -> 1/1, 
ImageSize -> {300, 300}, 
PolarTicks -> {{0.897, 2}, {0.897*2, 3}, {0.897*3, 4}, {0.897*4, 
5}, {0.897*5, 6}, {0.897*6, 7}, {0.897*7, 1}}]

Mathematica graphics

$\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.