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

Function test_pie_textprops

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

Source from the content-addressed store, hash-verified

6797
6798
6799def test_pie_textprops():
6800 data = [23, 34, 45]
6801 labels = ["Long name 1", "Long name 2", "Long name 3"]
6802
6803 textprops = dict(horizontalalignment="center",
6804 verticalalignment="top",
6805 rotation=90,
6806 rotation_mode="anchor",
6807 size=12, color="red")
6808
6809 _, texts, autopct = plt.gca().pie(data, labels=labels, autopct='%.2f',
6810 textprops=textprops)
6811 for labels in [texts, autopct]:
6812 for tx in labels:
6813 assert tx.get_ha() == textprops["horizontalalignment"]
6814 assert tx.get_va() == textprops["verticalalignment"]
6815 assert tx.get_rotation() == textprops["rotation"]
6816 assert tx.get_rotation_mode() == textprops["rotation_mode"]
6817 assert tx.get_size() == textprops["size"]
6818 assert tx.get_color() == textprops["color"]
6819
6820
6821def test_pie_get_negative_values():

Callers

nothing calls this directly

Calls 6

pieMethod · 0.80
gcaMethod · 0.80
get_rotation_modeMethod · 0.80
get_rotationMethod · 0.45
get_sizeMethod · 0.45
get_colorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…