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

Method _from_ax_coords

lib/matplotlib/backend_bases.py:1534–1547  ·  view source on GitHub ↗

Generate a synthetic event at a given axes coordinate. This method is intended for creating events during testing. The event can be emitted by calling its ``_process()`` method.

(cls, name, ax, xy, key, *args, **kwargs)

Source from the content-addressed store, hash-verified

1532
1533 @classmethod
1534 def _from_ax_coords(cls, name, ax, xy, key, *args, **kwargs):
1535 """
1536 Generate a synthetic event at a given axes coordinate.
1537
1538 This method is intended for creating events during testing. The event
1539 can be emitted by calling its ``_process()`` method.
1540 """
1541 # Separate from MouseEvent._from_ax_coords instead of being defined in the base
1542 # class, due to different parameter order in the constructor signature.
1543 x, y = ax.transData.transform(xy)
1544 event = cls(name, ax.figure.canvas, key, x, y, *args, **kwargs)
1545 event.inaxes = ax
1546 event.xdata, event.ydata = xy # Force exact xy to avoid fp roundtrip issues.
1547 return event
1548
1549
1550# Default callback for key events.

Callers 15

test_rotateFunction · 0.45
test_panFunction · 0.45
test_rectangle_selectorFunction · 0.45
test_span_selectorFunction · 0.45
test_lasso_selectorFunction · 0.45
test_TextBoxFunction · 0.45
test__buttons_callbacksFunction · 0.45
polygon_place_vertexFunction · 0.45
polygon_remove_vertexFunction · 0.45

Calls 1

transformMethod · 0.45

Tested by 15

test_rotateFunction · 0.36
test_panFunction · 0.36
test_rectangle_selectorFunction · 0.36
test_span_selectorFunction · 0.36
test_lasso_selectorFunction · 0.36
test_TextBoxFunction · 0.36
test__buttons_callbacksFunction · 0.36
polygon_place_vertexFunction · 0.36
polygon_remove_vertexFunction · 0.36