Create interactive Matplotlib figures!
Project description
Interactive Figure
This package serves for students to learn the basics of Python, Matplotlib and setting up reaction time experiments (visual search task, Stroop task, etc.). For a more accurate timing environment one should refer to e.g. PsychoPy.
This is currently used at the University of Amsterdam (UvA) in the course Introduction to Python Programming for Neuroscientists.
Package created using Hatch.
Installation
pip install interactive-figure
Usage
from interactive_figure import interactive_figure
interactive_figure.create()
# Wait until user input is received.
interactive_figure.wait_for_interaction()
key = interactive_figure.get_last_key_press()
print(f"Pressed key: {key}")
interactive_figure.close()
Demos can be found in the demo folder on GitHub.
Limitations
- Waiting for user input will not work in Jupyter Notebooks and the interactive interpreter due to the way Matplotlib handles events.
- Automated testing is hard since tests should cover multiple backends (macosx, QtAgg, Tkgg) on multiple platforms (Windows, macOS, Linux). Tips are very welcome!
Development
# Setup
pipx install hatch
hatch shell
# Build
hatch version fix
hatch build -c
./generate_docs.sh
# Publish
hatch publish
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
File details
Details for the file interactive_figure-0.4.1.tar.gz
.
File metadata
- Download URL: interactive_figure-0.4.1.tar.gz
- Upload date:
- Size: 9.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f5be7b6d45e81c0e7fa709304821bb6b7cc76b03b20b364aa46efff61dac0aa |
|
MD5 | e658d1b1cf96f9c4d457890d1a9793f5 |
|
BLAKE2b-256 | 234160c68c87561e7d2af8e6be72e17e360990380c3de5b5f8ebddbfe5ad41cd |
File details
Details for the file interactive_figure-0.4.1-py3-none-any.whl
.
File metadata
- Download URL: interactive_figure-0.4.1-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.27.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bfd2150144fa88278087d8927e023a750b5ddc90f8299259bc6284e2ac8da1e |
|
MD5 | 2fa3b862bcb64d0cb8a19b51ad165140 |
|
BLAKE2b-256 | c55ecb55aa2588762476af494fed8c92c2558f895b36fdd55ed719c0f8007807 |