| 6622 | |
| 6623 | @image_comparison(['pie_default.png'], style='mpl20') |
| 6624 | def test_pie_default(): |
| 6625 | # The slices will be ordered and plotted counter-clockwise. |
| 6626 | labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' |
| 6627 | sizes = [15, 30, 45, 10] |
| 6628 | colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral'] |
| 6629 | explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs') |
| 6630 | fig1, ax1 = plt.subplots(figsize=(8, 6)) |
| 6631 | ax1.pie(sizes, explode=explode, labels=labels, colors=colors, |
| 6632 | autopct='%1.1f%%', shadow=True, startangle=90) |
| 6633 | |
| 6634 | |
| 6635 | @image_comparison(['pie_linewidth_0.png', 'pie_linewidth_0.png', 'pie_linewidth_0.png'], |