Create interactive Matplotlib figures!
Project description
Interactive Figure
This package serves for students to learn about Python and basic reaction time experiments (visual search task, Stroop task, etc.). For a more accurate timing environment one should refer to e.g. PsychoPy.
Package created using Hatch.
Installation
pip install interactive-figure
Usage
from interactive_figure import interactive_figure
interactive_figure.create()
# Stall until user input is received.
interactive_figure.wait_for_interaction()
key = interactive_figure.get_last_keypress()
print(f"Pressed key: {key}")
interactive_figure.close()
Demos can be found in the demo folder on GitHub.
Functionality
User interaction:
- Capture key presses, button presses and mouse location
Figure control:
- Create
- Toggle fullscreen
- Clear
- Wait
- Wait for interaction (optionally timeout)
- Draw
- Close
Limitations
Waiting for user input will not work in Jupyter notebooks and the interactive interpreter due to the way Matplotlib handles events.
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for interactive_figure-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1e008d4789180892570ceb37628f98675c35d97707664655962a446497d56dc |
|
MD5 | 13891e0fc667933d3ebb320f63013490 |
|
BLAKE2b-256 | b944dc200619c7e62c413043e43a9255cab1688c22e439b74f4957284dca11ba |