@@ -42,11 +42,22 @@ def radar_factory(num_vars, frame='circle'):
42
42
# calculate evenly-spaced axis angles
43
43
theta = np .linspace (0 , 2 * np .pi , num_vars , endpoint = False )
44
44
45
+ class RadarTransform (PolarAxes .PolarTransform ):
46
+
47
+ def transform_path_non_affine (self , path ):
48
+ # Paths with non-unit interpolation steps correspond to gridlines,
49
+ # in which case we force interpolation (to defeat PolarTransform's
50
+ # autoconversion to circular arcs).
51
+ if path ._interpolation_steps > 1 :
52
+ path = path .interpolated (num_vars )
53
+ return Path (self .transform (path .vertices ), path .codes )
54
+
45
55
class RadarAxes (PolarAxes ):
46
56
47
57
name = 'radar'
48
58
# use 1 line segment to connect specified points
49
59
RESOLUTION = 1
60
+ PolarTransform = RadarTransform
50
61
51
62
def __init__ (self , * args , ** kwargs ):
52
63
super ().__init__ (* args , ** kwargs )
@@ -175,7 +186,7 @@ def example_data():
175
186
horizontalalignment = 'center' , verticalalignment = 'center' )
176
187
for d , color in zip (case_data , colors ):
177
188
ax .plot (theta , d , color = color )
178
- ax .fill (theta , d , facecolor = color , alpha = 0.25 )
189
+ ax .fill (theta , d , facecolor = color , alpha = 0.25 , label = '_nolegend_' )
179
190
ax .set_varlabels (spoke_labels )
180
191
181
192
# add legend relative to top-left plot
0 commit comments