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
Close
Hashes for interactive_figure-0.4.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb5a6553c663a492c56c8483ffc6b1b08b3d04bdd68ed4cb824cf6cd53fdf3ee |
|
MD5 | abe4c4a5c04448371149795d24b73855 |
|
BLAKE2b-256 | 4ce17bcb62f085eb7aa9e4519d5c1bf5ecdfe5f06e83a68435eff11d0c3e15ba |