Skip to main content

A set of tools to help format matplotlib figures

Project description

pyplotdesigner

Design matplotlib figure layouts visually, then reuse them in Python.

PyPI package: https://pypi.org/project/pyplotdesigner/

Quickstart (recommended: PyPI)

1) Install with pip

pip install -U pip
pip install pyplotdesigner

2) Start the GUI

python -m pyplotdesigner.gui.main

This opens your browser automatically. If it does not, open:

  • http://127.0.0.1:8080/ui

Optional:

  • python -m pyplotdesigner.gui.main --no-browser (disable auto-open)
  • python -m pyplotdesigner.gui.main --reload (enable auto-reload for dev)

3) Build a layout in the GUI

  1. Click Add Axis.
  2. Drag boxes into place.
  3. Add constraints (align, match size, aspect ratio, spacing, etc.).
  4. Click Import/Export and copy the base64 layout string.

4) Use the exported layout in Python

from pyplotdesigner.core.design_loader import make_figure_from_b64

layout_b64 = "PASTE_EXPORTED_STRING"
fig, axes = make_figure_from_b64(layout_b64)

# Example:
# left_panel = axes['left_panel']
# left_panel.plot([0, 1], [0, 1])

If you need to: clone and install locally

git clone git@github.com:gnwong/pyplotdesigner.git
cd pyplotdesigner
pip install -U pip
pip install -e .

Run tests

pip install pytest
pytest

Frontend E2E tests (Playwright)

These tests exercise the real browser UI against the FastAPI app.

Install once:

npm install
npx playwright install chromium

Run E2E suite:

npm run e2e

Useful variants:

npm run e2e:headed
npm run e2e:ui

Contributing

Contributions are welcome.

Expected workflow:

  1. Open an issue (or reference an existing one) describing the change.
  2. Create a focused branch and implement the change.
  3. Add or update tests for any new feature or behavior change.
  4. Run tests locally (pytest) and make sure they pass.
  5. Open a PR with a clear summary and testing notes.

Guidelines:

  • Keep changes focused and minimal.
  • Preserve existing behavior unless your PR intentionally changes it.
  • If behavior changes, document it and include regression coverage.

License

MIT (see LICENSE).

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

pyplotdesigner-0.5.1.tar.gz (37.2 kB view details)

Uploaded Source

Built Distribution

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

pyplotdesigner-0.5.1-py3-none-any.whl (39.8 kB view details)

Uploaded Python 3

File details

Details for the file pyplotdesigner-0.5.1.tar.gz.

File metadata

  • Download URL: pyplotdesigner-0.5.1.tar.gz
  • Upload date:
  • Size: 37.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for pyplotdesigner-0.5.1.tar.gz
Algorithm Hash digest
SHA256 bc42009ff6750489e703defec5f32d054a095e9bda8d5702a278dded8508aac4
MD5 87d94a61806b1166cc2f8726b266d498
BLAKE2b-256 e48787c31b1b0872c86839ce463c6b9bec4874fbd3c6295899ec7e3761eeefc9

See more details on using hashes here.

File details

Details for the file pyplotdesigner-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: pyplotdesigner-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 39.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.5

File hashes

Hashes for pyplotdesigner-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 24e41a281174215f988e825bf50869791327d01ee22900df7909282c93b15f85
MD5 ad4e16ac82bf631a42901ce3ef96292e
BLAKE2b-256 0b474415758c31a77578981b9042c1169391b525a5b5bbf64a0ea21a4d6a9390

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