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.3.tar.gz
(5.8 kB
view details)
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 myplots-0.1.3.tar.gz.
File metadata
- Download URL: myplots-0.1.3.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7df3c8e8a1c0ac00f9235c655bdb2759659c56067b2e3c009ea54019dc410472
|
|
| MD5 |
9c5aa7b42c36ce5b008b2d6a151e74e7
|
|
| BLAKE2b-256 |
7d1e0ec76232aaf2160f016d7affc6b357df3b4f5c98a5a4703c7e3d53803673
|
File details
Details for the file myplots-0.1.3-py3-none-any.whl.
File metadata
- Download URL: myplots-0.1.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
119f4824b4e61faa71e01cd26fdf746ea3df515f41b05526036a86af59b55f71
|
|
| MD5 |
c9c12c54c9fd757ccf2a4721ff935b5e
|
|
| BLAKE2b-256 |
2d4bcef67edf919a21df24b188d0bba66ae8c761748a57714dd68baa89cf778f
|