Skip to main content

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

import interactive_figure as ifig

ifig.create()
# Wait until user input is received.
ifig.wait_for_interaction()
key = ifig.get_last_key_press()
print(f"Pressed key: {key}")
ifig.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

interactive_figure-0.5.0.tar.gz (9.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

interactive_figure-0.5.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file interactive_figure-0.5.0.tar.gz.

File metadata

  • Download URL: interactive_figure-0.5.0.tar.gz
  • Upload date:
  • Size: 9.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for interactive_figure-0.5.0.tar.gz
Algorithm Hash digest
SHA256 ad70a690dd13ddcb77096d1b1ee58ba9f5df60b7f4452036cd6a57faa65be6b2
MD5 0530ea67087f6cbc6d26471e3ad07a93
BLAKE2b-256 e0fbbfb042efb76e3e924abf8ecc7a35aee039b28356ebe946891b2e8878f64a

See more details on using hashes here.

File details

Details for the file interactive_figure-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for interactive_figure-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 821ed5c1928d85dad0dfdcf5c6df237324a5b7de3d02782408d2489665029df3
MD5 7b292d99a0007d6bc67c8a13798bdac3
BLAKE2b-256 60c9d13f42fd3902e94ebb50335a1806d0b60a436e1b80f02eeed7ca5ac11d30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page