Skip to main content
gsplot logo

Documentation PyPI Python License: MIT

gsplot

gsplot is a small scientific-plotting toolkit built on Matplotlib. It adds convenient figure layouts, consistent styling helpers, configurable defaults, and lightweight version/configuration metadata while keeping ordinary Matplotlib Figure and Axes objects in the workflow.

The package is still evolving. Check the documentation and the issue tracker before depending on behavior that is not covered by the public API.

Install

gsplot supports Python 3.10 and newer:

python -m pip install gsplot

Quick example

import gsplot as gs

axes = gs.axes(size=(8, 4), mosaic="AB", store=True)
gs.line(axes[0], [0, 1, 2], [0, 1, 4], label="quadratic")
gs.scatter(axes[1], [0, 1, 2], [0, 1, 4], label="samples")
gs.legend_axes()
gs.show("quickstart", show=False)

This creates a two-panel Matplotlib figure, saves quickstart.png when storage is enabled, and remains compatible with regular Matplotlib operations:

axes[0].set_title("A regular Matplotlib Axes")

For a complete scientific example, see the paper-plot demo.

Configuration

Place a gsplot.json file in the working directory, or in ~/.config/gsplot/gsplot.json, to provide defaults for supported functions. The first matching location is used. A path can also be loaded explicitly:

import gsplot as gs

gs.config_load("path/to/gsplot.json")

When a value is specified more than once, the precedence is:

  1. an argument passed directly to the function;
  2. the corresponding function entry in gsplot.json;
  3. the function's default value.

See the configuration guide for the supported file layout and backend notes.

Development

The repository uses Poetry and targets Python 3.10 or newer. With a compatible Python interpreter:

python -m pip install "poetry==2.4.1"
poetry install
MPLBACKEND=Agg poetry run pytest -q
MPLBACKEND=Agg poetry run sphinx-build -W -b html docs docs/_build/html

The demos under demo/ are executable documentation. Run one from its own directory, for example:

cd demo/1_axes
python axes.py

See the developer setup guide for formatting, type checking, packaging, and Docker instructions.

For private vulnerability reports and the supported-version policy, see SECURITY.md.

Authors

This repository was forked from code developed by Giordano Mattoni.

  • Giordano Mattoni
  • Soichiro Yamane

License

This project is distributed under the MIT License.

Download files

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

Source Distribution

gsplot-0.3.0.tar.gz (53.8 kB view details)

Uploaded Source

Built Distribution

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

gsplot-0.3.0-py3-none-any.whl (71.3 kB view details)

Uploaded Python 3

File details

Details for the file gsplot-0.3.0.tar.gz.

File metadata

  • Download URL: gsplot-0.3.0.tar.gz
  • Upload date:
  • Size: 53.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gsplot-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e3ccc284c0e3d5bb6c133ee635e183601603b31e766ba4f41763fe671e86c2a8
MD5 bfe8b5dde64189f0fbda3d21cf0a11d4
BLAKE2b-256 56a7e81d08c8130340a5b20d02ecfb5ed1609a08b7adc629272a16c4fdcb7c3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsplot-0.3.0.tar.gz:

Publisher: publish_package.yml on SoichiroYamane/gsplot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gsplot-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: gsplot-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 71.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for gsplot-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 538fb5266235716043d415b8bdbf3cd3e7ae3c7708e6701a97ae7ef929404846
MD5 68c2bf17fb5e7b7a1c4e12fc508cd78a
BLAKE2b-256 9fa3a57e64aafa98c8b047b560729962b2100b0833f6c32aee3dd801a3eaef48

See more details on using hashes here.

Provenance

The following attestation bundles were made for gsplot-0.3.0-py3-none-any.whl:

Publisher: publish_package.yml on SoichiroYamane/gsplot

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

This release

0.3.0 This release

2 files

0.2.0

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page