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

Function test_format_cursor_data

lib/matplotlib/tests/test_image.py:457–465  ·  view source on GitHub ↗
(data, text)

Source from the content-addressed store, hash-verified

455 ([[0, 0]], "[0.00]"),
456 ])
457def test_format_cursor_data(data, text):
458 from matplotlib.backend_bases import MouseEvent
459
460 fig, ax = plt.subplots()
461 im = ax.imshow(data)
462
463 xdisp, ydisp = ax.transData.transform([0, 0])
464 event = MouseEvent('motion_notify_event', fig.canvas, xdisp, ydisp)
465 assert im.format_cursor_data(im.get_cursor_data(event)) == text
466
467
468@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 6

MouseEventClass · 0.90
imshowMethod · 0.80
format_cursor_dataMethod · 0.80
subplotsMethod · 0.45
transformMethod · 0.45
get_cursor_dataMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…