22
22
fig .subplots_adjust (top = 0.92 , bottom = 0.08 )
23
23
plt .setp ((ax , ax2 ), aspect = "equal" )
24
24
25
- ###############################################################################
25
+
26
26
# Now it's time for the pie. Starting with a pie recipe, we create the data
27
27
# and a list of labels from it.
28
28
#
@@ -69,7 +69,6 @@ def func(pct, allvals):
69
69
ax .set_title ("Matplotlib bakery: A pie" )
70
70
71
71
72
- ###############################################################################
73
72
# Now it's time for the donut. Starting with a donut recipe, we transcribe
74
73
# the data to numbers (converting 1 egg to 50 g), and directly plot the pie.
75
74
# The pie? Wait... it's going to be donut, is it not?
@@ -113,10 +112,10 @@ def func(pct, allvals):
113
112
x = np .cos (np .deg2rad (ang ))
114
113
horizontalalignment = ["" , "left" , "right" ][int (np .sign (x ))]
115
114
connectionstyle = "angle,angleA=0,angleB={}" .format (ang )
116
- kw ["arrowprops" ].update ({"connectionstyle" :connectionstyle })
115
+ kw ["arrowprops" ].update ({"connectionstyle" : connectionstyle })
117
116
ax2 .annotate (recipe [i ], xy = (x , y ), xytext = (1.35 * np .sign (x ), 1.4 * y ),
118
117
horizontalalignment = horizontalalignment , ** kw )
119
118
120
119
ax2 .set_title ("Matplotlib bakery: A donut" )
121
120
122
- plt .show ()
121
+ plt .show ()
0 commit comments