Skip to main content

An opinionated library for scientific figures in matplotlib.

Project description

sacredfig

SacredFig is a Python library that provides opinionated styles for scientific figures in matplotlib.

Installation

Use the package manager pip to install SacredFig.

pip install sacredfig

Usage

import matplotlib.pyplot as plt

import seaborn as sns
sns.reset_orig()
iris = sns.load_dataset("iris")

import sacredfig
from sacredfig import cm2in

plt.style.use(sacredfig.style)

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

ax.boxplot([iris.sepal_length.values, iris.sepal_width.values],
           labels=['Sepal length', 'Sepal width'])

ax.set_box_aspect(1)
ax.set(xlabel="Attribute", ylabel="Empirical distribution", ylim=(0, 10));

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

sacredfig-0.1.1.tar.gz (4.1 kB view hashes)

Uploaded Source

Built Distribution

sacredfig-0.1.1-py3-none-any.whl (4.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page