From 2df6720564fe05c6314b9088b58243f73df6a8bd Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Sun, 13 Feb 2022 12:16:07 +0100 Subject: [PATCH] Small improvements related to radar_chart example. A small block at the end of polar.py is described as not strictly necessary, but is in fact used by the radar_chart example. Perhaps a unittest would be better, but for now, just note that this should not be changed without manual checking. RESOLUTION is unused; remove it. --- examples/specialty_plots/radar_chart.py | 2 -- lib/matplotlib/projections/polar.py | 7 +++++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/specialty_plots/radar_chart.py b/examples/specialty_plots/radar_chart.py index 339ca269e45d..48ca607a2df3 100644 --- a/examples/specialty_plots/radar_chart.py +++ b/examples/specialty_plots/radar_chart.py @@ -55,8 +55,6 @@ def transform_path_non_affine(self, path): class RadarAxes(PolarAxes): name = 'radar' - # use 1 line segment to connect specified points - RESOLUTION = 1 PolarTransform = RadarTransform def __init__(self, *args, **kwargs): diff --git a/lib/matplotlib/projections/polar.py b/lib/matplotlib/projections/polar.py index d8f7231a0ff9..f2acf95269e5 100644 --- a/lib/matplotlib/projections/polar.py +++ b/lib/matplotlib/projections/polar.py @@ -1444,9 +1444,12 @@ def drag_pan(self, button, key, x, y): self.set_rmax(p.rmax / scale) -# to keep things all self contained, we can put aliases to the Polar classes +# To keep things all self-contained, we can put aliases to the Polar classes # defined above. This isn't strictly necessary, but it makes some of the -# code more readable (and provides a backwards compatible Polar API) +# code more readable, and provides a backwards compatible Polar API. In +# particular, this is used by the :doc:`/gallery/specialty_plots/radar_chart` +# example to override PolarTransform on a PolarAxes subclass, so make sure that +# that example is unaffected before changing this. PolarAxes.PolarTransform = PolarTransform PolarAxes.PolarAffine = PolarAffine PolarAxes.InvertedPolarTransform = InvertedPolarTransform