Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A zero dependency Matplotlib add-on that ships a scientific publication-ready plotting style with a few helper utilities.

License

Notifications You must be signed in to change notification settings

c0rychu/physics-plot

Repository files navigation

physics-plot

PyPI - Version PyPI - Downloads

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 sheetphysics_plot.pp_base enforces serif fonts, LaTeX math, minimalist grids, and high-resolution exports out of the box.
  • Legend utilitiesphysics_plot.Handles makes it easy to build custom legend entries for artists (e.g., violin plots) that don’t expose a label argument.

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

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

About

A zero dependency Matplotlib add-on that ships a scientific publication-ready plotting style with a few helper utilities.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

AltStyle によって変換されたページ (->オリジナル) /