mpl-template: matplotlib report template constructor
Project description
mpl-template
A python class for creating full report figures, including borders, titleblocks, logos, and content, entirely within matplotlib.
Quick start
Simply importing mpl_template lets you use the report template module.
import matplotlib as mpl
from mpl_template import template
import math
report_fig = template.Template(figsize=(8.5, 11), draft=True, scriptname='template.py')
title_block = [
{
'name': 'title',
'text': {
's': 'Example Figure',
'x': 0.5,
'y': 0.5,
'va': 'center',
'ha': 'center',
}
},
{},{},{},{},
]
report_fig.titleblock_content = title_block
report_fig.path_text = 'template.py'
fig = report_fig.setup_figure()
page_ax = report_fig.add_page()
# create a sub-gridspec that will be used for the main image
left, right, top, bottom = report_fig.margins
main = report_fig.gsfig[4 + top:-(report_fig.t_h + bottom + 8), 8 + left:-(right + 8)]
gs_timeseries = mpl.gridspec.GridSpecFromSubplotSpec(3, 1, main, hspace=0.3, wspace=0.3)
for n in range(3):
ax = fig.add_subplot(gs_timeseries[n])
ax.set_ylim(-2.5, 2.5)
plot = ax.plot([math.sin(i * (n + 1)) for i in range(0, 100)])
Installation
Dependencies
requires: matplotlib
optional: pillow, requests
tests: pytest, pytest-mpl, pytest-cov
Official Releases
TODO: release on pypi For now, please install from source.
Development Builds
This is a pure-python package, so building from source is easy on all platforms:
git clone https://github.com/austinorr/mpl-template.git
cd mpl-template
pip install -e .
Testing
Testing is done via pytest:
$pytest --mpl
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
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 mpl_template-0.7.0.tar.gz.
File metadata
- Download URL: mpl_template-0.7.0.tar.gz
- Upload date:
- Size: 2.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30ce148144f28b3b5e23d0d119ee7962c3c01f8fc11933819bb791ea6c4b0bca
|
|
| MD5 |
ff0354e23d7a971a29a3249f39bf2de0
|
|
| BLAKE2b-256 |
0cbd80dafa182ccf297881f7f2e0b404c927a688c63751e8aa4205f4b604c5c7
|
Provenance
The following attestation bundles were made for mpl_template-0.7.0.tar.gz:
Publisher:
publish.yml on austinorr/mpl-template
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mpl_template-0.7.0.tar.gz -
Subject digest:
30ce148144f28b3b5e23d0d119ee7962c3c01f8fc11933819bb791ea6c4b0bca - Sigstore transparency entry: 653178185
- Sigstore integration time:
-
Permalink:
austinorr/mpl-template@3ef3ef20baf29440c5929b0287135a66d6b0804f -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/austinorr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3ef3ef20baf29440c5929b0287135a66d6b0804f -
Trigger Event:
release
-
Statement type:
File details
Details for the file mpl_template-0.7.0-py3-none-any.whl.
File metadata
- Download URL: mpl_template-0.7.0-py3-none-any.whl
- Upload date:
- Size: 2.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0ba964323901754010b59956005b6166fc805c8199fb314de4e0ce28837bdbb
|
|
| MD5 |
8066e415fa0c5fb2772dadaed919934d
|
|
| BLAKE2b-256 |
adde4bc30d72775d1e2c2122f340169db5a71822178f6646d0babc27968e680e
|
Provenance
The following attestation bundles were made for mpl_template-0.7.0-py3-none-any.whl:
Publisher:
publish.yml on austinorr/mpl-template
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mpl_template-0.7.0-py3-none-any.whl -
Subject digest:
b0ba964323901754010b59956005b6166fc805c8199fb314de4e0ce28837bdbb - Sigstore transparency entry: 653178189
- Sigstore integration time:
-
Permalink:
austinorr/mpl-template@3ef3ef20baf29440c5929b0287135a66d6b0804f -
Branch / Tag:
refs/tags/v0.7.0 - Owner: https://github.com/austinorr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3ef3ef20baf29440c5929b0287135a66d6b0804f -
Trigger Event:
release
-
Statement type: