Skip to main content

PeerStyle

Publication-quality Matplotlib styling for peer-reviewed journals.

Installation

pip install peerstyle

Usage

import matplotlib.pyplot as plt
import peerstyle

# List available styles
print(peerstyle.list_styles())
# ['custom_style', 'ieee', 'nature', 'poster']

# Apply a specific style
peerstyle.use_style('nature')

Visual Gallery

Default (custom_style) IEEE Journal (ieee)
Nature Journal (nature) Presentation Poster (poster)

Available Styles

  • custom_style: The default serif scientific style (high DPI, LaTeX enabled).
  • ieee: Following IEEE journal guidelines (Times New Roman, specific sizing).
  • nature: Following Nature journal guidelines (Sans-serif, compact).
  • poster: High-visibility style with large fonts and thick lines for presentations.

Features

  • Journal Presets: Ready-to-use styles for IEEE, Nature, and more.
  • Modern Packaging: Fully installable via pip.
  • High Quality: Pre-configured for publication-quality PDF and PNG exports (300 DPI).
  • Flexible: Combine multiple styles or use them alongside standard Matplotlib styles.
  • Curved Text: Label lines directly along their paths — no legend needed.
  • CI/CD: Automated testing via GitHub Actions.

Curved Text — Direct Line Labeling

Label curves along their own paths instead of in a legend, so the eye never leaves the data to decode a colour key.

import numpy as np
import matplotlib.pyplot as plt
import peerstyle

peerstyle.use_style('nature')

x = np.linspace(0, 2 * np.pi, 400)

fig, ax = plt.subplots()
ax.plot(x, np.sin(x), color='C0')
ax.plot(x, np.cos(x), color='C1')

peerstyle.curved_text(ax, x, np.sin(x), 'sin(x)', pos=0.25, offset=6, color='C0')
peerstyle.curved_text(ax, x, np.cos(x), 'cos(x)', pos=0.30, offset=6, color='C1')

plt.show()

Placement is controlled by three parameters:

Parameter Default Description
pos 0.5 Where the label is anchored along the curve, as a fraction of arc length (0 = start, 1 = end).
anchor "center" Which part of the label lands at pos: "start", "center", or "end".
offset 0.0 Perpendicular shift off the curve in typographic points. Positive is above a left-to-right curve.

Extra keyword arguments (color, fontsize, alpha, fontfamily, …) are passed through to each character's matplotlib.text.Text.

The object-oriented form is also available:

from peerstyle import CurvedText

CurvedText(x, y, 'along the curve', ax, pos=0.2, anchor='start', offset=4.0)

The label recomputes its position on every draw, so it keeps following the curve through figure resizing and interactive panning or zooming.

Release files for peerstyle 0.1.3

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

Source distribution (sdist)

Source distribution for peerstyle 0.1.3
File Size Uploaded
peerstyle-0.1.3.tar.gz 4.5 kB Details

Built distribution (wheel)

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

Total release size: 10.3 kB

Release files / peerstyle-0.1.3.tar.gz

Download URL peerstyle-0.1.3.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b2d0dcb7b60075e22dc078565753160677162f0f95ec645a11f6e2c6ccbbe0ec
BLAKE2b-256 checksum
How to use checksums
b79092aab3e52f468c8f64470cc01aef0a91252a187c17eecb7f030c45f8a6bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.15

Release files / peerstyle-0.1.3-py3-none-any.whl

Download URL peerstyle-0.1.3-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1c45d6fc274665dd2e31c4f9df26a743e7977f4342e3835f0e16c4fc5447b81
BLAKE2b-256 checksum
How to use checksums
6118bd1f75ddb0e3a941ee2ce94fd267ec98d43d624fb2694a1860ede4e76b67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.15

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.0

2 release 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