The PolarListPlot Package
By Ted Ersek
ersektr@navair.navy.mil

Installation of the package can be achieved by making an "Enhancements" folder under  \(TraditionalForm\`\((…\AddOns\ExtraPackages)\)\). The source code for the package is in the file (PolarListPlot.m) which should be copied to the folder \(TraditionalForm\`\((…\AddOns\ExtraPackages\Enhancements)\)\).  Once the package is copied to this folder the package can be loaded by evaluating the next cell.

<< Enhancements`PolarListPlot`

I think you will find that my version of PolarListPlot is a vast improvement over the PolarListPlot function in the standard package Graphics`Graphics`. When my package is loaded it automatically removes a definition for PolarListPlot if one exists due to loading the Graphics`Graphics` package earlier. However, I couldn't prevent problems that will result if you load the Graphics`Graphics` package after loading my package.  If you want to eliminate all conflicts between the two packages, you can comment out the usage message and the definition for PolarListPlot in the file (Graphics . m)

The PolarListPlot implementation provided here takes a list of ordered pairs {{(Subscript[r, i]), (Subscript[θ, i])},   ... } and plots them similar to the way ListPlot does except polar coordinates are used and a polar grid is normally displayed.  The next cell gives an example and shows what the result looks like when the default option settings are used.  Notice PolarListPlot sorts the data before making the graphic.  You might also notice straight lines are not drawn between the points. The reason for this is explained latter and you can make the lines straight if you like.

data = {{49.6, ((3 π)/4)}, {55.5, ((4 π)/3)}, {29.0, ((23 π)/12)}, {27.1, ((7 π)/4)}, {25.7, (π/12)}, {33.3, (π/6)}, {51.4, (π/4)}, {32.9, (π/3)}, {28.9, ((5 π)/12)}, {35.0, ((19 π)/12)}, {56.5, (π/2)}, {54.5, ((7 π)/12)}, {43.6, ((2 π)/3)}, {31.6, ((5 π)/6)}, {46.4, ((11 π)/12)}, {29.2, π}, {28.3, ((13 π)/12)}, {25.4, ((7 π)/6)}, {27.1, ((5 π)/4)}, {44.8, ((17 π)/12)}, {29.3, ((3 π)/2)}, {31.1, ((5 π)/3)}, {54.0, ((11 π)/6)}, {43.8, 2 π}};
PolarListPlot[data];

PolarListPlot options

PolarListPlot has lots of options and the ones that are unique to PolarListPlot are explained and demonstrated below.  Some options that are common to built in Plot commands work a little different when used with PolarListPlot. These options are also explained and demonstrated below.

Options[PolarListPlot]

PlotJoined, InterpolationOrder

By default PolarListPlot draws lines between the data points, but the setting PlotJoined -> False can be used to prevent the lines from being drawn as in the next cell.

data = {{65, 
            0.3}, {65, ((2 π)/5)}, {45, ((4 π)/5)}, {40, ((6 π)/5)}, {45, ((8 π)/5)}};
 PolarListPlot[data, PlotJoined -> False];

When the setting (InterpolationOrder->None) is used simple straight lines are used to connect data points.  Normally one wants to show lines connecting the points when a continuous function is sampled at a number of points and one wants to show the approximate values the function likely had between the samples. The setting (InterpolationOrder->None) is used in the next cell and this causes the use of straight lines to connect the points.  This however, gives a poor approximation of the function between samples.

PolarListPlot[data, InterpolationOrder -> None];

By default PolarListPlot uses the setting (InterpolationOrder->1) in which case a first order Interpolation is used between points.  In that case the radius is assumed to be a linear function of θ and a parametric plot of {r[θ],θ} is made. As can be seen from the plot made by the next cell this setting often works very well.

PolarListPlot[data, InterpolationOrder -> 1];

In the next example the radius value jumps up and down between adjacent samples. When InterpolationOrder->1 (the default setting) is used on this data the interpolation has a kink at each data point.  By using InterpolationOrder->6 the interpolation over this data is smooth everywhere. The InterpolationOrder option is passed directly to Interpolation and a ParametricPlot of the resulting InterpolatingFunction is made.

data = {{65, 
            0.3}, {35, ((2 π)/5)}, {75, ((4 π)/5)}, {40, ((6 π)/5)}, {65, ((8 π)/5)}};
 PolarListPlot[data, InterpolationOrder -> 1];
PolarListPlot[data, InterpolationOrder -> 6];

Period

PolarListPlot has a Period option which specifies the angle for a full circle. The setting of this option is normally 2π or 360.  By default the setting (Period->2π) is used.  The next cell makes a plot where the angles are in degrees.

data = {{25, 10}, {65, 70}, {45, 140}, {75, 210}, {45, 
            280}};
PolarListPlot[data, Period -> 360];

InterpolationEnd

PolarListPlot has an InterpolationEnd option which specifies where the interpolation between samples should end. By default the setting (InterpolationEnd -> None) is used which causes an interpolation around the whole circle.  The next cell gives an example where the setting (InterpolationEnd -> 2  π) is used and the interpolation starts at the first data point after θ = 0 and stops at the last data point before θ = 2  π.

data = {{25, (π/5)}, {35, ((2 π)/5)}, {45, ((4 π)/5)}, {55, ((11 π)/10)}};
PolarListPlot[data, 
        InterpolationEnd -> 2  π];

The next cell gives an example where the setting (InterpolationEnd-> π) is used and the interpolation starts at the first data point after θ = π and ends at the last data point before θ =  π.

data = {{25, ((8 π)/5)}, {40, ((19 π)/10)}, {55, (( π)/10)}, {75, (( π)/5)}};
PolarListPlot[data, InterpolationEnd -> π];

AngularScaleFunction

PolarListPlot has an option AngularScaleFunction which is used specify a function that is be mapped to θ for each point, and also to the tick marks and angular gridlines.  

The next cell gives an example where the setting AngularScaleFunction -> (-# + 90 &)is used and the resulting plot follows the convention used for reading bearing off of a compass. In any practical application the setting for AngularScaleFunction will have the form AngularScaleFunction -> (Direction # + Theta &)where 
     (1)  Direction is 1 if a positive angle is Counter-Clockwise and (-1) if a positive angle is Clockwise.
     (2)  Theta is the angle from the positive x axis (if you think of rectangular coordinates) to the direction of an angle equal to zero. Theta should have units consistent with the setting of the Period option.

data = {{25, 10}, {65, 70}, {45, 140}, {75, 210}, {45, 
            280}};
PolarListPlot[data, Period -> 360, 
        AngularScaleFunction -> (-# + 90  &)];

LineStyle, PointStyle

PolarListPlot has options LineStyle and PointStyle which together do the same thing the PlotStyle option does for ListPlot, Plot and others.  By separating PlotStyle into two options one can easily make a graphic where visible points are shown for each data point and the points are connected with curves. This is in fact what PolarListPlot does when using the default option settings.  The default setting for PlotStyle is (PlotStyle->Automatic) which gives no indication exactly how thick the lines are or how large the points are. Instead the default settings for PointStyle and LineStyle are explicit graphics directives as the next cell shows.

Options[PolarListPlot, {PointStyle, LineStyle}]

I got the idea for splitting PlotStyle into two options from a message Allan Hayes once sent to the MathGroup.

In the next cell the PointStyle setting is an empty list in which case no points are drawn and we only get a curve connecting the points.

data = {{70, 
            0.1}, {60, ((2 π)/5)}, {70, ((4 π)/5)}, {60, ((6 π)/5)}, {70, ((8 π)/5)}};
PolarListPlot[data, PointStyle -> {}] ;

The next cell makes large green points and the curve is red as specified by the default setting for LineStyle.

PolarListPlot[data, 
        PointStyle -> {Hue[1/3, 1, 0.8], 
            AbsolutePointSize[9]}] ;

The next cell makes a thick green curve and the points are black as specified by the default setting for PointStyle.

PolarListPlot[data, 
        LineStyle -> {Hue[1/3, 1, 0.8], 
            AbsoluteThickness[2]}] ;

MaxRadius

The MaxRadius option specifies the maximum radius displayed in the graphic. The default setting is MaxRadius->Automatic in which case the maximum radius is slightly larger than the largest radius in the data set.  If a smaller setting is specified for MaxRadius, any points or interpolations beyond the MaxRadius are not shown. If the setting  Gridlines->Automatic is used a suitable grid consistent with the MaxRadius is made automatically.

The next cell makes a polar graph where some of the data points are beyond MaxRadius.

data = {{25.7, (π/12)}, {33.3, (π/6)}, {51.4, (π/4)}, {32.9, (π/3)}, {28.9, ((5 π)/12)}, {56.5, (π/2)}, {54.5, ((7 π)/12)}, {43.6, ((2 π)/3)}, {49.6, ((3 π)/4)}, {31.6, ((5 π)/6)}, {46.4, ((11 π)/12)}, {29.2, π}, {28.3, ((13 π)/12)}, {25.4, ((7 π)/6)}, {27.1, ((5 π)/4)}, {55.5, ((4 π)/3)}, {44.8, ((17 π)/12)}, {29.3, ((3 π)/2)}, {35.0, ((19 π)/12)}, {31.1, ((5 π)/3)}, {27.1, ((7 π)/4)}, {54.0, ((11 π)/6)}, {29.0, ((23 π)/12)}, {43.8, 
            2 π}};
PolarListPlot[data, MaxRadius -> 50];

The next cell makes a polar graph where MaxRadius is significantly larger than the largest radius in the data set.

PolarListPlot[data, MaxRadius -> 100];

GridLines, GridStyle

When using built in functions such as Plot the GridLines option is used to control the placement of gridlines and the style of those gridlines.  Instead this package provides a separate GridStyle option to specify the style of the gridlines.  This is demonstrated in the next cell where the default placement of gridlines is used and GridStyles specifies that the grid lines should be gray.

data = {{70, 
            0.1}, {60, ((2 π)/5)}, {70, ((4 π)/5)}, {60, ((6 π)/5)}, {70, ((8 π)/5)}};
PolarListPlot[data, 
        GridStyle -> GrayLevel[0.75]] ;

By default PolarListPlot uses the setting (GridLines->Automatic) in which case the polar grid is automatically created.  When another setting is desired the format provided should be GridLines->{rings, spokes} where rings and spokes can be Automatic or a list of graphics primitives.  In the next cell Spokes is a list of graphics primitives which result in more spokes than when the default setting is used.

data = {{70, 
            0.1}, {60, ((2 π)/5)}, {70, ((4 π)/5)}, {60, ((6 π)/5)}, {70, ((8 π)/5)}};
Spokes = 
        Table[Line[{{10*Cos[th], 10*Sin[th]}, {80*Cos[th], 
                80*Sin[th]}}], {th, 0, 
            2.0  π, π/12.0}];
PolarListPlot[data, 
        GridLines -> {Automatic, Spokes}] ;

In the next cell the setting  GridLines->{GridRings,Automatic} is used.  Here GridRings is a list of graphics primitives which results in fewer rings than when the default GridLines setting is used.

data = {{70, 
            0.1}, {60, ((2 π)/5)}, {70, ((4 π)/5)}, {60, ((6 π)/5)}, {70, ((8 π)/5)}};
GridRings = Circle[{0, 0}, #] &  /@ {10, 30, 50, 70, 
            80};
PolarListPlot[data, 
        GridLines -> {GridRings, Automatic}] ;

The next cell uses a list of graphics primitives for both rings and spokes.

PolarListPlot[data, 
        GridLines -> {GridRings, Spokes}] ;

Axes, AxesStyle

In the PolarListPlot package the Axes option only controls whether numbers are drawn to label the rings and spokes on the polar grid. By default the setting Axes->True is used.  In the next cell the setting Axes->False prevents numbers from appearing on the polar grid.

PolarListPlot[data, Axes -> False] ;

The next cell allows the display of numbers along the rings on the polar grid.

data = {{70, 
            0.1}, {60, ((2 π)/5)}, {70, ((4 π)/5)}, {60, ((6 π)/5)}, {70, ((8 π)/5)}};
PolarListPlot[data, Axes -> {True, False}] ;

The next cell allows the display of numbers by the spokes on the polar grid.

data = {{70, 
            0.1}, {60, ((2 π)/5)}, {70, ((4 π)/5)}, {60, ((6 π)/5)}, {70, ((8 π)/5)}};
PolarListPlot[data, Axes -> {False, True}] ;

In the next cell (tcks1) is a list of graphics primitives which specify that numbers should be drawn at certain places to label the rings and (False) specifies that no numbers should be drawn by the rings.

tcks1 = Text[#, {#, 0}, Background -> Automatic] &  /@ {20, 
            40, 60, 80};
PolarListPlot[data, Axes -> {tcks1, False}] ;

In the next cell (tcks2) is a list of graphics primitives which specify that numbers should be drawn for some of the spokes and (False) specifies that no numbers should be drawn by the rings.

tcks2 = Text[#, {92 Cos[#], 92 Sin[#]}, 
              Background -> Automatic] &  /@ {0, π/2, π, 
            3  π/2};
PolarListPlot[data, Axes -> {False, tcks2}] ;

The AxesStyle option specifies the style used for the numbers around the polar grid.  The next cell for example draws blue numbers around the polar grid.

data = {{70, 
            0.1}, {60, ((2 π)/5)}, {70, ((4 π)/5)}, {60, ((6 π)/5)}, {70, ((8 π)/5)}};
PolarListPlot[data, 
        AxesStyle ->  Hue[2/3, 1, 1]] ;

PlotRange

We can use the PlotRange option to specify the cartesian coordinates of that portion of the PolarPlot that should be displayed . The setting used in the next cell causes only the upper right portion of the plot to be shown.

data = {{70, 
            0.1}, {60, ((2 π)/5)}, {70, ((4 π)/5)}, {60, ((6 π)/5)}, {70, ((8 π)/5)}};
PolarListPlot[data, 
        PlotRange -> {{-3, 102}, {-3, 102}}] ;