lab74
lab74 is a Matplotlib style layer for scientific and institutional
figures in the technical print style of ca. 1965–1980.
The style uses fine rules, compact type, direct labels, monochrome textures, and one optional accent color. It does not add old-paper, film-grain, or other retro effects.
Installation
Install lab74 from PyPI:
pip install lab74
Requirements:
python>=3.12matplotlib>=3.8numpy>=1.26
Use
import matplotlib.pyplot as plt
import lab74
lab74.use()
fig, ax = plt.subplots()
ax.plot(x, y)
ax.set(xlabel="Energy (GeV)", ylabel=r"$\sigma$ (nb)")
The use() function applies the style. The default style is monochrome and
distinguishes series by line style alone, in proportional technical text.
Use these options to add an accent or to change the line series or typeface:
lab74.use("instrument") # Draw the first series in an accent.
lab74.use("aerospace") # Use a different accent.
lab74.use(line_series="grayscale") # Vary solid-line shades instead.
lab74.use(face="mono") # Use monospaced text.
An accent colors the first line of the cycle and carries through to bars,
bands, stairs, and contours. line_series applies only without one.
You can also apply the packaged Matplotlib style sheet:
plt.style.use(lab74.STYLE_PATH)
This sheet carries the same defaults as a bare lab74.use() call.
Plot tools
lab74 includes small tools for figure titles, annotations, region labels,
error bars, grouped bars, hatched regions, contours, maps, tables, ticks, grids,
frames, and multipanel layouts.
These tools return normal Matplotlib artists.
Thus, you can change the result with the Matplotlib API.
See src/lab74/ for all available tools and their docstrings.
Gallery
Executable notebooks are in the examples/.
Fonts
lab74 bundles IBM Plex Sans Condensed (the gothic face) and IBM Plex Mono
(the mono face), each in regular, italic, and medium weights, under the
SIL Open Font License 1.1. If neither font is
installed, lab74 falls back to DejaVu Sans and DejaVu Sans Mono.
Development
lab74 uses uv for environments,
Ruff for formatting and linting, and
ty for type checking. All four checks run in
CI on every push and pull request:
uv sync
uv run ruff format src tests
uv run ruff check src tests
uv run ty check
uv run pytest
License
lab74 is available 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
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 lab74-2.0.0.tar.gz.
File metadata
- Download URL: lab74-2.0.0.tar.gz
- Upload date:
- Size: 540.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5bf425ed67d2a84f87412bea1e7d5e7efb43b0ae395fa7d768743b287550798
|
|
| MD5 |
4a9f78e9e7519c58f9a7786679c3bf4b
|
|
| BLAKE2b-256 |
a83c25e246321997a8363f0e04510f439b24090071a325663da8a510727f0acf
|
Provenance
The following attestation bundles were made for lab74-2.0.0.tar.gz:
Publisher:
publish.yml on KarstenEconomou/lab74
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lab74-2.0.0.tar.gz -
Subject digest:
f5bf425ed67d2a84f87412bea1e7d5e7efb43b0ae395fa7d768743b287550798 - Sigstore transparency entry: 2706889274
- Sigstore integration time:
-
Permalink:
KarstenEconomou/lab74@5884250944a35939974d5a1b2d43c9a2e335518c -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/KarstenEconomou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5884250944a35939974d5a1b2d43c9a2e335518c -
Trigger Event:
release
-
Statement type:
File details
Details for the file lab74-2.0.0-py3-none-any.whl.
File metadata
- Download URL: lab74-2.0.0-py3-none-any.whl
- Upload date:
- Size: 543.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9101d5e5f73ccf6664a675967f3dfbc0b341bd41f2715ac25d9c5495ef67702b
|
|
| MD5 |
c33245cc890e5a9f05c5952f2de3bf0f
|
|
| BLAKE2b-256 |
0c6258f72d2301ed2f9bf797518040f96c6aafe933bdebc8bc51a4266200804b
|
Provenance
The following attestation bundles were made for lab74-2.0.0-py3-none-any.whl:
Publisher:
publish.yml on KarstenEconomou/lab74
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lab74-2.0.0-py3-none-any.whl -
Subject digest:
9101d5e5f73ccf6664a675967f3dfbc0b341bd41f2715ac25d9c5495ef67702b - Sigstore transparency entry: 2706889301
- Sigstore integration time:
-
Permalink:
KarstenEconomou/lab74@5884250944a35939974d5a1b2d43c9a2e335518c -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/KarstenEconomou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5884250944a35939974d5a1b2d43c9a2e335518c -
Trigger Event:
release
-
Statement type: