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

Function test_arrow_simple

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

Source from the content-addressed store, hash-verified

789
790@image_comparison(['arrow_simple.png'], remove_text=True, style='_classic_test')
791def test_arrow_simple():
792 # Simple image test for ax.arrow
793 # kwargs that take discrete values
794 length_includes_head = (True, False)
795 shape = ('full', 'left', 'right')
796 head_starts_at_zero = (True, False)
797 # Create outer product of values
798 kwargs = product(length_includes_head, shape, head_starts_at_zero)
799
800 fig, axs = plt.subplots(3, 4)
801 for i, (ax, kwarg) in enumerate(zip(axs.flat, kwargs)):
802 ax.set_xlim(-2, 2)
803 ax.set_ylim(-2, 2)
804 # Unpack kwargs
805 (length_includes_head, shape, head_starts_at_zero) = kwarg
806 theta = 2 * np.pi * i / 12
807 # Draw arrow
808 ax.arrow(0, 0, np.sin(theta), np.cos(theta),
809 width=theta/100,
810 length_includes_head=length_includes_head,
811 shape=shape,
812 head_starts_at_zero=head_starts_at_zero,
813 head_width=theta / 10,
814 head_length=theta / 10)
815
816
817def test_arrow_empty():

Callers

nothing calls this directly

Calls 4

arrowMethod · 0.80
subplotsMethod · 0.45
set_xlimMethod · 0.45
set_ylimMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…