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

Function test_fancyarrow_setdata

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

Source from the content-addressed store, hash-verified

712
713
714def test_fancyarrow_setdata():
715 fig, ax = plt.subplots()
716 arrow = ax.arrow(0, 0, 10, 10, head_length=5, head_width=1, width=.5)
717 expected1 = np.array(
718 [[13.54, 13.54],
719 [10.35, 9.65],
720 [10.18, 9.82],
721 [0.18, -0.18],
722 [-0.18, 0.18],
723 [9.82, 10.18],
724 [9.65, 10.35],
725 [13.54, 13.54]]
726 )
727 assert np.allclose(expected1, np.round(arrow.verts, 2))
728
729 expected2 = np.array(
730 [[16.71, 16.71],
731 [16.71, 15.29],
732 [16.71, 15.29],
733 [1.71, 0.29],
734 [0.29, 1.71],
735 [15.29, 16.71],
736 [15.29, 16.71],
737 [16.71, 16.71]]
738 )
739 arrow.set_data(
740 x=1, y=1, dx=15, dy=15, width=2, head_width=2, head_length=1
741 )
742 assert np.allclose(expected2, np.round(arrow.verts, 2))
743
744
745@image_comparison(["large_arc.svg"], style="mpl20")

Callers

nothing calls this directly

Calls 4

arrowMethod · 0.80
allcloseMethod · 0.80
subplotsMethod · 0.45
set_dataMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…