MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_pie_nolabel_but_legend

Function test_pie_nolabel_but_legend

lib/matplotlib/tests/test_axes.py:6762–6772  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6760
6761@image_comparison(['pie_no_label.png'], style='mpl20')
6762def test_pie_nolabel_but_legend():
6763 labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
6764 sizes = [15, 30, 45, 10]
6765 colors = ['yellowgreen', 'gold', 'lightskyblue', 'lightcoral']
6766 explode = (0, 0.1, 0, 0) # only "explode" the 2nd slice (i.e. 'Hogs')
6767 plt.pie(sizes, explode=explode, labels=labels, colors=colors,
6768 autopct='%1.1f%%', shadow=True, startangle=90, labeldistance=None,
6769 rotatelabels=True)
6770 plt.axis('equal')
6771 plt.ylim(-1.2, 1.2)
6772 plt.legend()
6773
6774
6775@image_comparison(['pie_shadow.png'], style='mpl20', tol=0.002)

Callers

nothing calls this directly

Calls 3

pieMethod · 0.80
axisMethod · 0.45
legendMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…