physics-plot
physics-plot is essentially a zero dependency python package shipping a Matplotlib style sheet — pp_base.mplstyle to create publication-quality plots with minimal effort. In addition, a few optional helper classes are provided.
Features
- Matplotlib style sheet —
physics_plot.pp_baseenforces serif fonts, LaTeX math, minimalist grids, and high-resolution exports out of the box. - Legend utilities —
physics_plot.Handlesmakes it easy to build custom legend entries for artists (e.g., violin plots) that don’t expose alabelargument.
Installation
pip install physics-plot
Quick Start
physics-plot can be installed via pip:
pip install physics-plot
There are basically two ways to use the physics-plot stylesheet. You can set it globally at the start of your script/notebook:
import matplotlib.pyplot as plt
plt.style.use("physics_plot.pp_base")
# ======================= #
# Your plotting code here #
# ======================= #
Or you can apply it to individual figures using a context manager:
import matplotlib.pyplot as plt
with plt.style.context("physics_plot.pp_base"):
# ======================= #
# Your plotting code here #
# ======================= #
Examples
-
Bode plot (
examples/bode-plot.py) generates a two-panel magnitude/phase plot for a first-order low-pass filter. -
Violin plot (
examples/violin-plot.ipynb) demonstrates how to pairHandleswithAxes.violinplotso the legend of the violin plot can be created, which is absent in Matplotlib.
Feel free to start from either example when styling your own figures.
Development
- Coming soon
License
This project is licensed under the MIT license.
Third-Party Licenses
This project includes or adapts files from:
- SciencePlots (MIT License) Copyright (c) 2018 John Garrett
- Matplotlib (BSD-compatible license) Copyright (c) 2012– Matplotlib Development Team
- Seaborn (BSD 3-Clause License) Copyright (c) 2012–2023, Michael L. Waskom
Metadata
Release files for physics-plot 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| physics_plot-0.2.3.tar.gz | 3.7 kB | Without provenance | Details for physics_plot-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| physics_plot-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for physics_plot-0.2.3-py3-none-any.whl |
Total release size: 9.1 kB
Release files / physics_plot-0.2.3.tar.gz
| Download URL | physics_plot-0.2.3.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f84e2d7492c1e74135acec10dfc74a0ddf77b36e5409f32fae7344aaf8db5fc
|
|
BLAKE2b-256 checksum How to use checksums |
2f43cb46b6061c67d6338ae11e990122d8f3da68434637d73bfdf5b98f230c35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.4
|
Release files / physics_plot-0.2.3-py3-none-any.whl
| Download URL | physics_plot-0.2.3-py3-none-any.whl |
|---|---|
| Size | 5.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
272bb757f17e346301ccbaa1ad69b47893d4fa5bdae637957433309dc331832b
|
|
BLAKE2b-256 checksum How to use checksums |
55a1e5d420e557ac8c922d2ab45c69ec30ad711b35be7a3b961e8505509b240a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.4
|
Security for physics-plot 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.