| Server IP : 35.80.110.71 / Your IP : 216.73.216.52 Web Server : Apache/2.4.58 (Ubuntu) System : Linux ip-172-31-21-44 6.17.0-1019-aws #19~24.04.1-Ubuntu SMP Tue Jun 23 18:53:06 UTC 2026 x86_64 User : ubuntu ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/matplotlib/testing/__pycache__/ |
Upload File : |
�
G8�c�
� �D � d Z ddlmZ ddlmZ d� Zd� Zd d�Zd d�Z d
d�Z
y)z|
========================
Widget testing utilities
========================
See also :mod:`matplotlib.tests.test_widgets`.
� N)�mockc �� � t j dd� \ } }|j ddgddg� |j d� |j j
j
� |S )z"Create a plot and return its axes.� r �� g �?)�plt�subplots�plot�
set_aspect�figure�canvas�draw)�fig�axs �</usr/lib/python3/dist-packages/matplotlib/testing/widgets.py�get_axr
sS � ��l�l�1�a� �G�C���G�G�Q��H�q�#�h���M�M�#���I�I������
�I� c � � y �N� )�args�kwargss r �noopr s � �r c �8 � t j � }||_ | j j ||f||fg� d \ |_ |_ ||c|_ |_ | |_ | j j |_ ||_ ||_
d|_ d|_ |S )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 : int
x coord of mouse in data coords.
ydata : int
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.
r N�Custom)r �Mock�button� transData� transform�x�y�xdata�ydata�inaxesr r �key�step�guiEvent�name)r r r! r"