I think I have found a fix that properly restores the behavior of ListPolarPlot
(explanation below):
(* execute once to fix issue *)
ListPlot@{};
If[$VersionNumber==11.2,
Begin["System`ProtoPlotDump`"],
Begin["System`ListPlotsDump`"]
];
SubValues@iListPlot = SubValues@iListPlot /.
HoldPattern[a : (graphicsoptions = _)] :>
(a; AppendTo[method, "OptimizePlotMarkers" -> optimizemarkers]);
End[];
This injects a single line into the definition of iListPlot
to restore the proper behavior of ListPolarPlot
:
(* the original example *)
ListPolarPlot[Table[1, 10], Joined -> True, PlotMarkers -> Automatic]
(* from https://mathematica.stackexchange.com/questions/19923/listpolarplot-labelling-points-on-the-plot *)
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}]
Before
After
Explanation
Note: To see the definitions I'm talking about, load <<GeneralUtilities`
and use PrintDefinitions@symbol
to get a readable version of the definitions. Also, the symbols have moved from System`ProtoPlotDump`
in 11.2 to System`ListPlotsDump`
in 11.3 (the below always refers to the 11.3 contexts).
The issue
ListPolarPlot
internally calls ListPlot
(via Graphics`PolarPlotDump`listPolarPlot
), and then transforms the result by interpreting the x-Axis as the angle and the y-Axis as the radius (see Graphics`PolarPlotDump`cleanup
).
Graphics`PolarPlotDump`cleanup
only works on GraphicsComplex
, so Graphics`PolarPlotDump`listPolarPlot
calls ListPlot
with "OptimizePlotMarkers"->False
, which should prevent a Normal
ization of the GraphicsComplex
to a simple list of coordinates.
- In 11.2, the code handling
"OptimizePlotMarkers"
was moved from System`ListPlotsDump`iListPlot
to System`ListPlotsDump`postProcessLayout
, but the option is never properly forwarded to that function.
- This causes the
GraphicsComplex
to be Normal
ized, which in turn causes Graphics`PolarPlotDump`cleanup
to fail.
The fix
- Since
System`ListPlotsDump`postProcessLayout
reads out the method
parameter to determine the value of "OptimizePlotMarkers"
, we simply need to add the setting to that list to forward it.
- We have to do it after
graphicsoptions
is built, since System`ListPlotsDump`renderLayoutProcess
silently crashes the kernel if the Method
option contains the "OptimizePlotMarkers"
setting.
ListPolarPlot[Table[1, {10}], Joined -> True, PlotMarkers -> Automatic]
works fine in version 10.4. $\endgroup$