Skip to content

cynddl/sacredfig

Repository files navigation

sacredfig: standard styles for scientific figures in matplotlib

pypi python Build Status codecov Code Quality

Installation

Use the package manager pip to install SacredFig.

pip install sacredfig

Usage

Simply import the package and use the sacredfig style:

import matplotlib.pyplot as plt
import sacredfig

plt.style.use(sacredfig.style)

fig, ax = plt.subplots(figsize=(4, 4), dpi=150)
ax.grid(False, which='major', axis='x')

ax.plot([0, 1], [0, 1])
ax.set_box_aspect(1)
ax.set(xlabel="x", ylabel="y")

You can also use sacredfig temporarily:

with plt.style.context(sacredfig.style):
    ax.plot(np.sin(np.linspace(0, 2 * np.pi)), 'r-o')

Releases

No releases published

Packages

No packages published

Languages