| 6774 | |
| 6775 | @image_comparison(['pie_shadow.png'], style='mpl20', tol=0.002) |
| 6776 | def test_pie_shadow(): |
| 6777 | # Also acts as a test for the shade argument of Shadow |
| 6778 | sizes = [15, 30, 45, 10] |
| 6779 | colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral'] |
| 6780 | explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice |
| 6781 | _, axes = plt.subplots(2, 2) |
| 6782 | axes[0][0].pie(sizes, explode=explode, colors=colors, |
| 6783 | shadow=True, startangle=90, |
| 6784 | wedgeprops={'linewidth': 0}) |
| 6785 | |
| 6786 | axes[0][1].pie(sizes, explode=explode, colors=colors, |
| 6787 | shadow=False, startangle=90, |
| 6788 | wedgeprops={'linewidth': 0}) |
| 6789 | |
| 6790 | axes[1][0].pie(sizes, explode=explode, colors=colors, |
| 6791 | shadow={'ox': -0.05, 'oy': -0.05, 'shade': 0.9, 'edgecolor': 'none'}, |
| 6792 | startangle=90, wedgeprops={'linewidth': 0}) |
| 6793 | |
| 6794 | axes[1][1].pie(sizes, explode=explode, colors=colors, |
| 6795 | shadow={'ox': 0.05, 'linewidth': 2, 'shade': 0.2}, |
| 6796 | startangle=90, wedgeprops={'linewidth': 0}) |
| 6797 | |
| 6798 | |
| 6799 | def test_pie_textprops(): |