@@ -3314,6 +3314,25 @@ def test_pie_linewidth_0():
3314
3314
plt .axis ('equal' )
3315
3315
3316
3316
3317
+ @image_comparison (baseline_images = ['pie_center_radius' ], extensions = ['png' ])
3318
+ def test_pie_center_radius ():
3319
+ # The slices will be ordered and plotted counter-clockwise.
3320
+ labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
3321
+ sizes = [15 , 30 , 45 , 10 ]
3322
+ colors = ['yellowgreen' , 'gold' , 'lightskyblue' , 'lightcoral' ]
3323
+ explode = (0 , 0.1 , 0 , 0 ) # only "explode" the 2nd slice (i.e. 'Hogs')
3324
+
3325
+ plt .pie (sizes , explode = explode , labels = labels , colors = colors ,
3326
+ autopct = '%1.1f%%' , shadow = True , startangle = 90 ,
3327
+ wedgeprops = {'linewidth' : 0 }, center = (1 ,2 ), radius = 1.5 )
3328
+
3329
+ plt .annotate ("Center point" , xy = (1 ,2 ), xytext = (1 ,1.5 ),
3330
+ arrowprops = dict (arrowstyle = "->" ,
3331
+ connectionstyle = "arc3" ))
3332
+ # Set aspect ratio to be equal so that pie is drawn as a circle.
3333
+ plt .axis ('equal' )
3334
+
3335
+
3317
3336
@image_comparison (baseline_images = ['pie_linewidth_2' ], extensions = ['png' ])
3318
3337
def test_pie_linewidth_2 ():
3319
3338
# The slices will be ordered and plotted counter-clockwise.
0 commit comments