Save and reload editable matplotlib figures as .plt files
Project description
PltEdit
A simple tool to save matplotlib figures as a unique file and edit them afterward while keeping data integrity
Overview
PltEdit is a Python package that lets you save a matplotlib figure (or axes) — including all its underlying data — to a single .plt file, and reload it in another Python session or in a Streamlit-based GUI.
Unlike matplotlib's built-in savefig() (which exports to raster/vector image formats), a .plt file preserves the full figure object so it can be displayed, inspected, and edited programmatically.
File format
A .plt file is a NumPy archive (.npz) with a custom .plt extension. It contains two arrays:
| Key | Content |
|---|---|
figure |
uint8 array — pickle-serialised matplotlib.figure.Figure |
metadata |
0-D object array — JSON string with creation info |
The metadata JSON includes:
{
"created_at": "2024-01-15T12:00:00+00:00",
"python_version": "3.12.3 (main, ...)",
"matplotlib_version": "3.10.1",
"pltedit_version": "0.1.0"
}
Installation
# Core library only
pip install pltedit
# With the Streamlit GUI
pip install pltedit[app]
Usage
Python API
import matplotlib.pyplot as plt
import pltedit as plte
# Create a figure
fig, ax = plt.subplots()
ax.plot([1, 2, 3], [4, 5, 6], label="my data")
ax.set_title("My plot")
# Save to .plt
plte.save(fig, "my_figure.plt")
# Load in another session
fig2 = plte.load("my_figure.plt")
# Change style
fig2 = plte.set_style(fig2, "seaborn-v0_8")
# Display
fig2.show()
# Inspect metadata
from pltedit._io import get_metadata
meta = get_metadata("my_figure.plt")
print(meta["created_at"])
You can also pass an Axes object directly to save():
plte.save(ax, "from_axes.plt")
Streamlit GUI
pltedit # open the GUI (file upload)
pltedit path/to/figure.plt # open the GUI with a pre-loaded file
The GUI lets you:
- Upload any
.pltfile - View the stored figure metadata
- Edit the figure title, axis labels, and axis limits interactively
Development
git clone https://github.com/VForiel/PltEdit.git
cd PltEdit
pip install -e ".[dev]"
pytest
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pltedit-0.1.2.tar.gz.
File metadata
- Download URL: pltedit-0.1.2.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f97fd6dd21e1681343251d49200fa40e4de4d93d83a8a6310e13df435ec4ac2
|
|
| MD5 |
ed7e3f78203b7ddfb031c8466278854e
|
|
| BLAKE2b-256 |
363dc253284abaeec569275a3a620fbbbdee59057449d04276646512e5bfcfa4
|
Provenance
The following attestation bundles were made for pltedit-0.1.2.tar.gz:
Publisher:
publish.yml on VForiel/PltEdit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pltedit-0.1.2.tar.gz -
Subject digest:
6f97fd6dd21e1681343251d49200fa40e4de4d93d83a8a6310e13df435ec4ac2 - Sigstore transparency entry: 1450174364
- Sigstore integration time:
-
Permalink:
VForiel/PltEdit@6d332ba43d5f967e4b7c7c57a59542ea261c2d14 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/VForiel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6d332ba43d5f967e4b7c7c57a59542ea261c2d14 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pltedit-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pltedit-0.1.2-py3-none-any.whl
- Upload date:
- Size: 16.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e6502e3f98595331cf6e37e695da17899e46fe6a82e62ac04c6d384432a128bc
|
|
| MD5 |
3551dae1f04eba547f743c0c1854f758
|
|
| BLAKE2b-256 |
4fec7d1046ed4d3cd9446e989ec5ec9cda7ff4a34fda06926e9b79be824bd78c
|
Provenance
The following attestation bundles were made for pltedit-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on VForiel/PltEdit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pltedit-0.1.2-py3-none-any.whl -
Subject digest:
e6502e3f98595331cf6e37e695da17899e46fe6a82e62ac04c6d384432a128bc - Sigstore transparency entry: 1450174425
- Sigstore integration time:
-
Permalink:
VForiel/PltEdit@6d332ba43d5f967e4b7c7c57a59542ea261c2d14 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/VForiel
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@6d332ba43d5f967e4b7c7c57a59542ea261c2d14 -
Trigger Event:
push
-
Statement type: