+
    i                     L    R t ^ RIHt ^ RIHt R tR tRR ltRR lt	R	R lt
R# )
z|
========================
Widget testing utilities
========================

See also :mod:`matplotlib.tests.test_widgets`.
)mockNc                     \         P                  ! ^^4      w  rVP                  ^ ^.^ ^.4       VP                  R4       V P                  P                  4        V# )z"Create a plot and return its Axes.g      ?)pltsubplotsplot
set_aspectcanvasdraw)figaxs     z/Users/tonyclaw/.openclaw/workspace/skills/math-calculator/venv/lib/python3.14/site-packages/matplotlib/testing/widgets.pyget_axr      sI    ll1a GCGGQHq#hMM#JJOOI    c                      R # N )argskwargss   *,r   noopr      s    r   c                @   \         P                  ! 4       pWn        V P                  P	                  W#3W#3.4      ^ ,          w  Vn        Vn        W#uVn        Vn        Wn	        V P                  RR7      P                  Vn        WFn        WVn        RVn        RVn        V# )a  
Create a mock event that can stand in for `.Event` and its subclasses.

This event is intended to be used in tests where it can be passed into
event handling functions.

Parameters
----------
ax : `~matplotlib.axes.Axes`
    The Axes the event will be in.
xdata : float
    x coord of mouse in data coords.
ydata : float
    y coord of mouse in data coords.
button : None or `MouseButton` or {'up', 'down'}
    The mouse button pressed in this event (see also `.MouseEvent`).
key : None or str
    The key pressed when the mouse event triggered (see also `.KeyEvent`).
step : int
    Number of scroll steps (positive for 'up', negative for 'down').

Returns
-------
event
    A `.Event`\-like Mock instance.
T)rootNCustom)r   Mockbutton	transData	transformxyxdataydatainaxes
get_figurer   keystepguiEventname)r   r   r   r   r"   r#   events   &&&&&& r   
mock_eventr'      s    6 IIKEL||--~05~/? @@ACEGUW$EKL==d=+22ELIJENEJLr   c                \    \        V P                  W#WEV4      p\        W4      pV! V4       R# )a  
Trigger an event on the given tool.

Parameters
----------
tool : matplotlib.widgets.AxesWidget
etype : str
    The event to trigger.
xdata : float
    x coord of mouse in data coords.
ydata : float
    y coord of mouse in data coords.
button : None or `MouseButton` or {'up', 'down'}
    The mouse button pressed in this event (see also `.MouseEvent`).
key : None or str
    The key pressed when the mouse event triggered (see also `.KeyEvent`).
step : int
    Number of scroll steps (positive for 'up', negative for 'down').
N)r'   r   getattr)	tooletyper   r   r   r"   r#   r&   funcs	   &&&&&&&  r   do_eventr-   D   s)    ( twwu4@E4DKr   c           	     J   Ve    \        V RV^ ,          V^,          ^VR7       \        V RV^ ,          V^,          ^R7       \        V RV^ ,          V^,          ^R7       \        V RV^ ,          V^,          ^R7       Ve"   \        V RV^ ,          V^,          ^VR7       R# R# )	aM  
Helper to simulate a mouse drag operation.

Parameters
----------
tool : `~matplotlib.widgets.Widget`
start : [float, float]
    Starting point in data coordinates.
end : [float, float]
    End point in data coordinates.
key : None or str
     An optional key that is pressed during the whole operation
     (see also `.KeyEvent`).
Non_key_press)r   r   r   r"   press)r   r   r   onmovereleaseon_key_release)r-   )r*   startendr"   s   &&&&r   click_and_dragr6   ]   s     ~U1XU1Xs	$ T7%(%(1ET83q6QBT9CF#a&C
's1vSVs	$ r   )       r8   Nr7   r   )__doc__unittestr   matplotlib.pyplotpyplotr   r   r   r'   r-   r6   r   r   r   <module>r=      s,     	&R2$r   