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

Function test_rotated_arcs

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

Source from the content-addressed store, hash-verified

764
765@image_comparison(["all_quadrants_arcs.svg"], style="mpl20")
766def test_rotated_arcs():
767 fig, ax_arr = plt.subplots(2, 2, squeeze=False, figsize=(10, 10))
768
769 scale = 10_000_000
770 diag_centers = ((-1, -1), (-1, 1), (1, 1), (1, -1))
771 on_axis_centers = ((0, 1), (1, 0), (0, -1), (-1, 0))
772 skews = ((2, 2), (2, 1/10), (2, 1/100), (2, 1/1000))
773
774 for ax, (sx, sy) in zip(ax_arr.ravel(), skews):
775 k = 0
776 for prescale, centers in zip((1 - .0001, (1 - .0001) / np.sqrt(2)),
777 (on_axis_centers, diag_centers)):
778 for j, (x_sign, y_sign) in enumerate(centers, start=k):
779 a = Arc(
780 (x_sign * scale * prescale,
781 y_sign * scale * prescale),
782 scale * sx,
783 scale * sy,
784 lw=4,
785 color=f"C{j}",
786 zorder=1 + j,
787 angle=np.rad2deg(np.arctan2(y_sign, x_sign)) % 360,
788 label=f'big {j}',
789 gid=f'big {j}'
790 )
791 ax.add_patch(a)
792
793 k = j+1
794 ax.set_xlim(-scale / 4000, scale / 4000)
795 ax.set_ylim(-scale / 4000, scale / 4000)
796 ax.axhline(0, color="k")
797 ax.axvline(0, color="k")
798 ax.set_axis_off()
799 ax.set_aspect("equal")
800
801
802def test_fancyarrow_shape_error():

Callers

nothing calls this directly

Calls 10

ArcClass · 0.90
sqrtMethod · 0.80
add_patchMethod · 0.80
axhlineMethod · 0.80
axvlineMethod · 0.80
subplotsMethod · 0.45
set_xlimMethod · 0.45
set_ylimMethod · 0.45
set_axis_offMethod · 0.45
set_aspectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…