-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GitHub Actions and Codecov versions
- Loading branch information
Showing
3 changed files
with
47 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
build: | ||
environment: | ||
python: 3.11 | ||
python: 3.11.8 | ||
nodes: | ||
tests: | ||
dependencies: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,47 @@ | ||
# sacredfig | ||
# sacredfig: standard styles for scientific figures in matplotlib | ||
|
||
<div align="center"> | ||
|
||
[![pypi](https://img.shields.io/pypi/v/sacredfig.svg)](https://pypi.org/project/sacredfig/) | ||
[![python](https://img.shields.io/pypi/pyversions/sacredfig.svg)](https://pypi.org/project/sacredfig/) | ||
[![Build Status](https://github.com/cynddl/sacredfig/actions/workflows/tests.yml/badge.svg)](https://github.com/cynddl/sacredfig/actions) | ||
[![codecov](https://codecov.io/gh/cynddl/sacredfig/branch/main/graphs/badge.svg?branch=main)](https://codecov.io/github/cynddl/sacredfig?branch=main) | ||
[![Code Quality](https://img.shields.io/scrutinizer/g/cynddl/sacredfig.svg)](https://scrutinizer-ci.com/g/cynddl/sacredfig/?branch=main) | ||
|
||
</div> | ||
|
||
SacredFig is a Python library that provides opinionated styles for scientific figures in matplotlib. | ||
|
||
|
||
## Installation | ||
|
||
Use the package manager [pip](https://pip.pypa.io/en/stable/) to install SacredFig. | ||
|
||
```bash | ||
pip install sacredfig | ||
pip install sacredfig | ||
``` | ||
|
||
## Usage | ||
|
||
Simply import the package and use the sacredfig style: | ||
|
||
```python | ||
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') | ||
``` |