Skip to main content

lab74

PyPI Python versions License

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.

Calculated characteristics of an n+-p-p+ silicon solar cell

Installation

Install lab74 from PyPI:

pip install lab74

Requirements:

  • python>=3.12
  • matplotlib>=3.8
  • numpy>=1.26

Use

lab74 colour reproduction standard

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/.

Apollo 17 orange and gray soil grain-size distributions

Apollo 17 subsurface heat-flow temperatures

Lunar landing-site soil composition by terrain type

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

lab74-2.0.0.tar.gz (540.0 kB view details)

Uploaded Source

Built Distribution

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

lab74-2.0.0-py3-none-any.whl (543.0 kB view details)

Uploaded Python 3

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

Hashes for lab74-2.0.0.tar.gz
Algorithm Hash digest
SHA256 f5bf425ed67d2a84f87412bea1e7d5e7efb43b0ae395fa7d768743b287550798
MD5 4a9f78e9e7519c58f9a7786679c3bf4b
BLAKE2b-256 a83c25e246321997a8363f0e04510f439b24090071a325663da8a510727f0acf

See more details on using hashes here.

Provenance

The following attestation bundles were made for lab74-2.0.0.tar.gz:

Publisher: publish.yml on KarstenEconomou/lab74

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

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

Hashes for lab74-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9101d5e5f73ccf6664a675967f3dfbc0b341bd41f2715ac25d9c5495ef67702b
MD5 c33245cc890e5a9f05c5952f2de3bf0f
BLAKE2b-256 0c6258f72d2301ed2f9bf797518040f96c6aafe933bdebc8bc51a4266200804b

See more details on using hashes here.

Provenance

The following attestation bundles were made for lab74-2.0.0-py3-none-any.whl:

Publisher: publish.yml on KarstenEconomou/lab74

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

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 files

1.0.0

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