| 6703 | |
| 6704 | @image_comparison(['pie_ccw_true.png'], style='mpl20') |
| 6705 | def test_pie_ccw_true(): |
| 6706 | # The slices will be ordered and plotted counter-clockwise. |
| 6707 | labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' |
| 6708 | sizes = [15, 30, 45, 10] |
| 6709 | colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral'] |
| 6710 | explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs') |
| 6711 | |
| 6712 | plt.pie(sizes, explode=explode, labels=labels, colors=colors, |
| 6713 | autopct='%1.1f%%', shadow=True, startangle=90, |
| 6714 | counterclock=True) |
| 6715 | # Set aspect ratio to be equal so that pie is drawn as a circle. |
| 6716 | plt.axis('equal') |
| 6717 | |
| 6718 | |
| 6719 | @image_comparison(['pie_frame_grid.png'], style='mpl20') |