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

Function test_arrow_set_data

lib/matplotlib/tests/test_patches.py:968–994  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

966
967
968def test_arrow_set_data():
969 fig, ax = plt.subplots()
970 arrow = mpl.patches.Arrow(2, 0, 0, 10)
971 expected1 = np.array(
972 [[1.9, 0.],
973 [2.1, -0.],
974 [2.1, 8.],
975 [2.3, 8.],
976 [2., 10.],
977 [1.7, 8.],
978 [1.9, 8.],
979 [1.9, 0.]]
980 )
981 assert np.allclose(expected1, np.round(arrow.get_verts(), 2))
982
983 expected2 = np.array(
984 [[0.39, 0.04],
985 [0.61, -0.04],
986 [3.01, 6.36],
987 [3.24, 6.27],
988 [3.5, 8.],
989 [2.56, 6.53],
990 [2.79, 6.44],
991 [0.39, 0.04]]
992 )
993 arrow.set_data(x=.5, dx=3, dy=8, width=1.2)
994 assert np.allclose(expected2, np.round(arrow.get_verts(), 2))
995
996
997@check_figures_equal(extensions=["png", "pdf", "svg", "eps"])

Callers

nothing calls this directly

Calls 4

set_dataMethod · 0.95
allcloseMethod · 0.80
get_vertsMethod · 0.80
subplotsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…