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

Function test_clipping_zoom

lib/matplotlib/tests/test_artist.py:128–143  ·  view source on GitHub ↗
(fig_test, fig_ref)

Source from the content-addressed store, hash-verified

126
127@check_figures_equal()
128def test_clipping_zoom(fig_test, fig_ref):
129 # This test places the Axes and sets its limits such that the clip path is
130 # outside the figure entirely. This should not break the clip path.
131 ax_test = fig_test.add_axes((0, 0, 1, 1))
132 l, = ax_test.plot([-3, 3], [-3, 3])
133 # Explicit Path instead of a Rectangle uses clip path processing, instead
134 # of a clip box optimization.
135 p = mpath.Path([[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]])
136 p = mpatches.PathPatch(p, transform=ax_test.transData)
137 l.set_clip_path(p)
138
139 ax_ref = fig_ref.add_axes((0, 0, 1, 1))
140 ax_ref.plot([-3, 3], [-3, 3])
141
142 ax_ref.set(xlim=(0.5, 0.75), ylim=(0.5, 0.75))
143 ax_test.set(xlim=(0.5, 0.75), ylim=(0.5, 0.75))
144
145
146def test_cull_markers():

Callers

nothing calls this directly

Calls 4

add_axesMethod · 0.80
plotMethod · 0.45
set_clip_pathMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…