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

Function test_rotate_rect_draw

lib/matplotlib/tests/test_patches.py:182–199  ·  view source on GitHub ↗
(fig_test, fig_ref)

Source from the content-addressed store, hash-verified

180
181@check_figures_equal()
182def test_rotate_rect_draw(fig_test, fig_ref):
183 ax_test = fig_test.add_subplot()
184 ax_ref = fig_ref.add_subplot()
185
186 loc = (0, 0)
187 width, height = (1, 1)
188 angle = 30
189 rect_ref = Rectangle(loc, width, height, angle=angle)
190 ax_ref.add_patch(rect_ref)
191 assert rect_ref.get_angle() == angle
192
193 # Check that when the angle is updated after adding to an Axes, that the
194 # patch is marked stale and redrawn in the correct location
195 rect_test = Rectangle(loc, width, height)
196 assert rect_test.get_angle() == 0
197 ax_test.add_patch(rect_test)
198 rect_test.set_angle(angle)
199 assert rect_test.get_angle() == angle
200
201
202@check_figures_equal()

Callers

nothing calls this directly

Calls 5

get_angleMethod · 0.95
set_angleMethod · 0.95
RectangleClass · 0.90
add_subplotMethod · 0.80
add_patchMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…