Skip to main content

gleplot

Tests Docs License: GPL-2.0-or-later

gleplot writes standard GLE (Graphics Layout Engine) scripts from Python, through matplotlib's names where they map cleanly. GLE compiles the script to publication-quality PDF, EPS, SVG, PNG or JPG.

Measured points with horizontal and vertical error bars, and a dashed y = x² curve through them

The code that draws it (the gallery's Combined X+Y Error Bars example):

import numpy as np
import gleplot as glp

x = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
y = np.array([1.8, 4.2, 9.1, 16.3, 24.8])
xerr = np.array([0.15, 0.20, 0.10, 0.25, 0.18])
yerr = np.array([0.3, 0.5, 0.6, 0.8, 1.0])

fig = glp.figure(figsize=(8, 6))
ax = fig.add_subplot(111)
ax.errorbar(x, y, yerr=yerr, xerr=xerr, fmt="o", color="blue", capsize=4,
            label="Measured")
x_fit = np.linspace(0.5, 5.5, 100)
ax.plot(x_fit, x_fit**2, color="red", linestyle="--", label="y = x²")
ax.set_xlabel("x")
ax.set_ylabel("y")
ax.set_title("Combined X and Y Error Bars")
ax.legend()

fig.savefig("fit.gle")  # the GLE script and its data files; GLE not needed
fig.savefig("fit.pdf")  # compiled by GLE

Why gleplot

  • The output is a script you can read and edit. fit.gle is a short plain-text GLE file, with the data in .dat files beside it. Change a label or a colour by hand, and GLE compiles it to vector PDF, EPS or SVG, or to PNG or JPG.
  • Scripts open again. glp.open_gle("fit.gle") reads a .gle file back into a Figure you can change from Python and save.
  • Unrecognised GLE is kept. When you open a hand-written file, GLE that gleplot does not model is written back in place on save rather than dropped, and each place it had to keep raw GLE or guess is recorded as a note (opening GLE files).
  • GLE is optional for writing. Saving .gle works without GLE installed; you need GLE only to compile.

Install

gleplot needs Python 3.9 or later and numpy. Install it from PyPI:

pip install gleplot

For the latest development version, install from GitHub with pip install git+https://github.com/BenHuddart/gleplot.git.

To compile figures, install GLE 4.3+ from the GLE releases and check it with gle -info. GLE's include library (gleinc) is required too; the release packages ship it, and GLE's include library covers a GLE built from source. The getting started guide covers Ghostscript, LaTeX and gle -finddeps.

To work on gleplot itself, use an editable install with the development tools, as described in CONTRIBUTING.md:

git clone https://github.com/BenHuddart/gleplot.git
cd gleplot
pip install -e ".[dev]"

What it can plot

The gallery shows every example with its code.

Coming from matplotlib

figure, subplots, plot, scatter, errorbar, savefig and the other matplotlib names take matplotlib's arguments. Where GLE cannot do what a keyword asks, gleplot accepts it and warns; the matplotlib migration guide lists each difference. gleplot does not emulate what GLE cannot draw, so there is no pie chart, box plot or broken axis.

Upgrading from gleplot 5

gleplot 6 removes those features, raises on a bad argument when the call is made, and draws with matplotlib's colour cycle and bars without an outline. Migrating from gleplot 5 to 6 lists each change and what to use instead.

Documentation

The documentation site has the user guides and the API reference.

Contributing

See CONTRIBUTING.md. Questions and feature requests go to GitHub issues.

License

gleplot is licensed under the GPL-2.0 or later.

Metadata

Release files for gleplot 6.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gleplot 6.0.0
File Size Uploaded Provenance Actions
gleplot-6.0.0.tar.gz 541.7 kB With provenance Details for gleplot-6.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gleplot 6.0.0
File Interpreter ABI Platform Actions
gleplot-6.0.0-py3-none-any.whl Python 3 none any Details for gleplot-6.0.0-py3-none-any.whl

Total release size: 1.1 MB

Release files / gleplot-6.0.0.tar.gz

Download URL gleplot-6.0.0.tar.gz
Size 541.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8edf27a323c77ca30842c61b23920bcaab895c1ee0945b98c8210ff0a64a97d3
BLAKE2b-256 checksum
How to use checksums
6ebfd895f500cde399dcb63c56f18a4506de8b2c9d931c39e9606819410019d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / gleplot-6.0.0-py3-none-any.whl

Download URL gleplot-6.0.0-py3-none-any.whl
Size 554.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
286859ff373446773d56bc19fc81c2639ef6400cb04037a91ef050a5b9ddbabc
BLAKE2b-256 checksum
How to use checksums
e3b2a2d63b59253bd16705c0fc458c106b42ae2c4b638ce99013c4a90a25fc63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for gleplot 6.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for gleplot-6.0.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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