@@ -3314,6 +3314,25 @@ def test_pie_linewidth_0():
33143314 plt .axis ('equal' )
33153315
33163316
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+
33173336@image_comparison (baseline_images = ['pie_linewidth_2' ], extensions = ['png' ])
33183337def test_pie_linewidth_2 ():
33193338 # The slices will be ordered and plotted counter-clockwise.
0 commit comments