Skip to main content

Lightweight plotting utilities for consistent well-readable matplotlib figures

Project description

myplots

Minimal plotting utilities for consistently formatted scientific matplotlib figures.

Usage

import myplots as p

p.use_style()
fig, ax = p.new()

Installation

Clone the repository and install in editable mode:

pip install -e .

Quick start

import numpy as np
import myplots as p

# Apply global plotting style
p.use_style(doc_fontsize=10, fig_width="single")

# Generate some data
x = np.linspace(0, 10, 100)
y = np.sin(x)

# Create figure
fig, ax = p.new()

# Plot
p.line(ax, x, y, label="signal")
p.label(ax, rf"{p.bm('x')} axis", rf"{p.bm('y')} axis")
p.legend(ax)

# Save
p.save(fig, "figure.png")

Plotting

p.line(ax, x, y)
p.scatter(ax, x, y)
p.errorbar(ax, x, y, yerr)

Subplots

fig, axs = p.new(nrows=2, ncols=2)

Labels and legends

p.label(ax, "x", "y", "Title")
p.legend(ax)

Subplot annotation

p.annotate_subplots(axs)

Domain specific helpers

p.plot_energy(ax, t, E)
p.plot_temperature(ax, t, T)
p.plot_histogram(ax, data)
p.plot_with_error(ax, x, y, yerr)

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

myplots-0.1.2.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

myplots-0.1.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file myplots-0.1.2.tar.gz.

File metadata

  • Download URL: myplots-0.1.2.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for myplots-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c066eca70c26bf79f3b8939a6cbd4d2728aefe68f91c30e5d3471b2535617229
MD5 33b94507342a0e872e3181824463c0c8
BLAKE2b-256 b6c79a8b2e62a757f4fcb27bcf6a2622a885b2ec5a7e8adffbd181b151326ca7

See more details on using hashes here.

File details

Details for the file myplots-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: myplots-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for myplots-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 912554860acb8fea95a8642e1fe995bcf2682c5f1eb6bcb37a2d4013f0435f6d
MD5 2d9c4711ae4472da11a391a6c29f610d
BLAKE2b-256 d76983218a90937eb9bac82e53a0f5d279d9443feff7097ab2541607fd9cc6a6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page