@@ -37,11 +37,10 @@ def radar_factory(num_vars, frame='circle'):
37
37
"""
38
38
# calculate evenly-spaced axis angles
39
39
theta = np .linspace (0 , 2 * np .pi , num_vars , endpoint = False )
40
- # rotate theta such that the first axis is at the top
41
- theta += np .pi / 2
42
40
43
41
def draw_poly_patch (self ):
44
- verts = unit_poly_verts (theta )
42
+ # rotate theta such that the first axis is at the top
43
+ verts = unit_poly_verts (theta + np .pi / 2 )
45
44
return plt .Polygon (verts , closed = True , edgecolor = 'k' )
46
45
47
46
def draw_circle_patch (self ):
@@ -60,6 +59,11 @@ class RadarAxes(PolarAxes):
60
59
# define draw_frame method
61
60
draw_patch = patch_dict [frame ]
62
61
62
+ def __init__ (self , * args , ** kwargs ):
63
+ super (RadarAxes , self ).__init__ (* args , ** kwargs )
64
+ # rotate plot such that the first axis is at the top
65
+ self .set_theta_zero_location ('N' )
66
+
63
67
def fill (self , * args , ** kwargs ):
64
68
"""Override fill so that line is closed by default"""
65
69
closed = kwargs .pop ('closed' , True )
@@ -93,7 +97,7 @@ def _gen_axes_spines(self):
93
97
94
98
# spine_type must be 'left', 'right', 'top', 'bottom', or `circle`.
95
99
spine_type = 'circle'
96
- verts = unit_poly_verts (theta )
100
+ verts = unit_poly_verts (theta + np . pi / 2 )
97
101
# close off polygon by repeating first vertex
98
102
verts .append (verts [0 ])
99
103
path = Path (verts )
0 commit comments