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

Function test_rectangle_add_remove_set

lib/matplotlib/tests/test_widgets.py:473–483  ·  view source on GitHub ↗
(ax)

Source from the content-addressed store, hash-verified

471
472
473def test_rectangle_add_remove_set(ax):
474 tool = widgets.RectangleSelector(ax, interactive=True)
475 # Draw rectangle
476 click_and_drag(tool, start=(100, 100), end=(130, 140))
477 assert tool.extents == (100, 130, 100, 140)
478 assert len(tool._state) == 0
479 for state in ['rotate', 'square', 'center']:
480 tool.add_state(state)
481 assert len(tool._state) == 1
482 tool.remove_state(state)
483 assert len(tool._state) == 0
484
485
486@pytest.mark.parametrize('use_data_coordinates', [False, True])

Callers

nothing calls this directly

Calls 3

click_and_dragFunction · 0.90
add_stateMethod · 0.80
remove_stateMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…