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
Release history Release notifications | RSS feed
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.1.tar.gz
(5.5 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.1.tar.gz.
File metadata
- Download URL: myplots-0.1.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d94296582a5e511b9c6e655077b077da6db528144f2add8e079dd16619cec8dc
|
|
| MD5 |
4d36e9b62ad045befa2cd2b30cab912e
|
|
| BLAKE2b-256 |
63a787e0bcec36cb1f5f260b5a26918ba187347fca655bb910d51544916dfb7e
|
File details
Details for the file myplots-0.1.1-py3-none-any.whl.
File metadata
- Download URL: myplots-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.0 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 |
0edf578556338a1fe04dd1c663e7b1d88d417f97b607660b5801485ca936e344
|
|
| MD5 |
cc8cadd9bc9eeb14f06ebc8a06a54c9b
|
|
| BLAKE2b-256 |
9521539ec16446407b8dec2bf6d29d1bf9649a9d3f25e6f51e2ea4774af43a23
|