@@ -3343,6 +3343,33 @@ def test_pie_ccw_true():
3343
3343
# Set aspect ratio to be equal so that pie is drawn as a circle.
3344
3344
plt .axis ('equal' )
3345
3345
3346
+
3347
+ @image_comparison (baseline_images = ['pie_frame_grid' ], extensions = ['png' ])
3348
+ def test_pie_frame_grid ():
3349
+ # The slices will be ordered and plotted counter-clockwise.
3350
+ labels = 'Frogs' , 'Hogs' , 'Dogs' , 'Logs'
3351
+ sizes = [15 , 30 , 45 , 10 ]
3352
+ colors = ['yellowgreen' , 'gold' , 'lightskyblue' , 'lightcoral' ]
3353
+ explode = (0 , 0.1 , 0 , 0 ) # only "explode" the 2nd slice (i.e. 'Hogs')
3354
+
3355
+ plt .pie (sizes , explode = explode , labels = labels , colors = colors ,
3356
+ autopct = '%1.1f%%' , shadow = True , startangle = 90 ,
3357
+ wedgeprops = {'linewidth' : 0 },
3358
+ frame = True , center = (2 ,2 ) )
3359
+
3360
+ plt .pie (sizes [::- 1 ], explode = explode , labels = labels , colors = colors ,
3361
+ autopct = '%1.1f%%' , shadow = True , startangle = 90 ,
3362
+ wedgeprops = {'linewidth' : 0 },
3363
+ frame = True , center = (5 ,2 ) )
3364
+
3365
+ plt .pie (sizes , explode = explode [::- 1 ], labels = labels , colors = colors ,
3366
+ autopct = '%1.1f%%' , shadow = True , startangle = 90 ,
3367
+ wedgeprops = {'linewidth' : 0 },
3368
+ frame = True , center = (3 ,5 ) )
3369
+ # Set aspect ratio to be equal so that pie is drawn as a circle.
3370
+ plt .axis ('equal' )
3371
+
3372
+
3346
3373
@cleanup
3347
3374
def test_margins ():
3348
3375
# test all ways margins can be called
0 commit comments