Metadata-Version: 2.1
Name: scistyles
Version: 1.2
Summary: scistyles: Matplotlib stylesheets for scientific publications.
Author: Samuel Palato
Description-Content-Type: text/markdown
Classifier: Framework :: Matplotlib
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: License :: OSI Approved :: MIT License
Requires-Dist: matplotlib>=3.7
Requires-Dist: pytest ; extra == "dev"
Requires-Dist: numpy ; extra == "dev"
Requires-Dist: flit ; extra == "dev"
Requires-Dist: lmfit ; extra == "dev"
Project-URL: Source, https://github.com/spalato/scistyles
Provides-Extra: dev

# scistyles
Matplotlib stylesheets for scientific publications.

# Installation
The package is available on pypi. Simply run:
```
pip install scistyles
```

# Usage
The first purpose of this module is to supply matplotlib stylesheets to assist
in the creation of scientific figures. Since `matplotlib 3.7.0`, this has
become quite easy. This module is still useful to collect stylesheets.

The stylesheets stored under `src/scistyles` are discovered by `matplotlib`.
Simply `use` them:
```python
import matplotlib.pyplot as plt
import scistyles

plt.style.use("scistyles.presentation-sp")
# plot away!
```

The module also provides a simple tool to format numbers with errors, such that
the number in parentheses indicates the error on the last digits, ready to
add to a plot.
```python
from scistyles.format import format_value_error
l = format_value_error(3.14159265, 0.1234) # "3.14(12)"
# the number of decimals can be controlled:
l = format_value_error(3.14159265, 0.1234, nd=1) # "3.1(1)"
```
If you use `lmfit`, you can use them directly on the `Parameter` in the fit
results.
```python
from scistyles.format import format_parameter
# get some data, setup some fit model.
result = model.fit(...)
label = format_parameter(result.params["important_variable"])
```

# Contributing
Contributions are welcome! In case you have strong disagreement with our choice
of tick width or legend `handlelength`, then fine, just contribute your own
stylesheet. We won't argue[^1], and just add it to the pile. Simply make sure
to give the stylesheet a name that is not already taken.

To contribute a stylesheet, just write an issue. For large contributions, a PR
would be appreciated.

# See also
For everything about `rcParams` and `stylesheets`, see the official [matplotlib
documentation](https://matplotlib.org/stable/tutorials/introductory/customizing.html).

# TODO
  
- [ ] Add a test plot and autogenerated gallery.
- [ ] add a few further design tools (colors, palettes...)
- [ ] Figure a way to store misc info such as two-column figure width, preferred
sublabel formats.

# Notes

[^1]: We aren't talking about colormaps.

