| 6688 | |
| 6689 | @image_comparison(['pie_linewidth_2.png'], style='mpl20') |
| 6690 | def test_pie_linewidth_2(): |
| 6691 | # The slices will be ordered and plotted counter-clockwise. |
| 6692 | labels = 'Frogs', 'Hogs', 'Dogs', 'Logs' |
| 6693 | sizes = [15, 30, 45, 10] |
| 6694 | colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral'] |
| 6695 | explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs') |
| 6696 | |
| 6697 | plt.pie(sizes, explode=explode, labels=labels, colors=colors, |
| 6698 | autopct='%1.1f%%', shadow=True, startangle=90, |
| 6699 | wedgeprops={'linewidth': 2}) |
| 6700 | # Set aspect ratio to be equal so that pie is drawn as a circle. |
| 6701 | plt.axis('equal') |
| 6702 | |
| 6703 | |
| 6704 | @image_comparison(['pie_ccw_true.png'], style='mpl20') |