CoolFace
Apppublic

Aluode/PerceptionLabPortable

sourceHugging Faceupdated 9mo agoView on Hugging Face
0likes
ViewBox.cpython-310.pyc41 linesDownload Raw Back to __pycache__
1o

2�Yi�	�@s�dZddlZddlZddlmZmZe�d�Z	e�3�Ze�d�e�
�e�dd�e��Ze�e�e��Ze�d�e�d�e��Ze��Ze�e�Gdd	�d	ej�Zee�ddd4d5��Ze�e� ddd��e�e�e�edd6�ej!�"e�ej#d
ed�Z$e�e$d7d8�ej#ded�Z%e�e%dd�e$j&ddd�e%j&ddd�dd�Z'dd�Z(e'd�\Z)Z*e(�e�+�e�,�Z-e-j.�/e(�e-�0d�e1dkr�e�2�dSdS)a9ViewBox is the general-purpose graphical container that allows the user to 10zoom / pan to inspect any area of a 2D coordinate system. 11 12This unimaginative example demonstrates the construction of a ViewBox-based13plot area with axes, very similar to the way PlotItem is built.14�N)�QtCore�	QtWidgetszViewBox Examplezpyqtgraph example: ViewBoxi iXc@s4eZdZdd�Zdd�Zdd�Zdd�Zd	d15�ZdS)�movableRectcGs"tjj|g|�R�|�d�dS)NT)r�QGraphicsRectItem�__init__ZsetAcceptHoverEvents)�self�args�r	��E:\DocsHouse\542 percep lab latest\PerceptionLab\PerceptionLab_Portable\python_embed\Lib\site-packages\pyqtgraph/examples/ViewBox.pyr$szmovableRect.__init__cCs*|��|_|�t�ddd��|��dS)N��)�pen�savedPen�setPen�pg�mkPen�ignore�rZevr	r	r16�hoverEnterEvent's17zmovableRect.hoverEnterEventcCs|�|j�|��dS�N)rr
rrr	r	r18�hoverLeaveEvent+szmovableRect.hoverLeaveEventcCsB|��tjjjkr|��|�|���|��|_dS|�	�dSr)19ZbuttonrZQtZMouseButtonZ20LeftButton�accept�mapToParent�pos�21pressDeltarrr	r	r22�mousePressEvent.szmovableRect.mousePressEventcCs|�|�|���|j�dSr)ZsetPosrrrrr	r	r23�mouseMoveEvent4szmovableRect.mouseMoveEventN)�__name__�24__module__�__qualname__rrrrrr	r	r	r25r#sr��d���bottom)ZorientationZlinkView�leftzD<span style='color: #ff0000; font-weight: bold'>X</span> <i>Axis</i>�s)�text�unitszY Axis�V)r&cCs�tj�|�}|t|d�t|d��d7<|t|d�d7<|t|d�t|d��d9<|t|d�d9<|t�||t|��t|�fS)Ng�������?g�p=26ף�?g�?g27ףp=28�?���)�np�random�intZarange�len�float)�n�datar	r	r29�randGs$$ r2cCstd�\}}tj||d�dS)N�')�y�x)r2�p1ZsetData)�yd�xdr	r	r3031updateDataPsr9r3�2�__main__)3�__doc__�numpyr+Z	pyqtgraphrZpyqtgraph.QtrrZmkQAppZappZQMainWindow�mwZsetWindowTitle�show�resizeZGraphicsView�gvZsetCentralWidgetZQGraphicsGridLayout�lZsetHorizontalSpacingZsetVerticalSpacingZViewBoxZvbZPlotDataItemr6ZaddItemrrZQRectF�rectrrZ
centralWidgetZ	setLayoutZAxisItemZxScaleZyScaleZsetLabelr2r9r7r8Z	autoRangeZQTimer�t�timeout�connect�startr�execr	r	r	r32�<module>sP3334353637383940	41�
Aluode/PerceptionLabPortable · CoolFace