a e s t h e t i c
Luke's matplotlib style sheets. Remixed from John Garrett's SciencePlots.
Preferences:
- Avoid constantly repeating matplotlib calls to prettify plots.
- Default font: Arial (not DejaVu Sans, which many systems don't have installed by default)
- Don't draw right and top axis spines unless they provide function.
- White on black reduces eye strain; make generating white on black figures easy by using
*_wobstyle sheets.
install
...via pip: pip install aesthetic
...via local clone: git clone git@github.com:lgbouma/aesthetic.git; cd aesthetic; pip install -e .
examples
for plot styles, see the test driver. the general syntax follows:
from aesthetic import set_style
set_style("clean")
set_style("clean_wob")
set_style("science")
set_style("science_wob")
So if you wanted to make four different versions of the same plot with responsive colors:
from aesthetic.plot import set_style
import numpy as np, matplotlib.pyplot as plt, matplotlib as mpl
def make_plot(style):
x = np.linspace(0,10,1000)
y = (x/100)**3 + 5*np.sin(x)
_x, _y = np.arange(2, 8, 0.5), np.arange(2, 8, 0.5)
fig, ax = plt.subplots(figsize=(3,2.5))
cs = [None]*3 if '_wob' not in style else ['cyan','lime','yellow']
ax.plot(x, y, label=f'style: {style}', color=cs[0])
ax.plot(x, y+3, color=cs[1])
ax.plot(x, y+6, color=cs[2])
_yerr = np.abs(np.random.normal(2, 1, _x.size))
c = 'k' if '_wob' not in style else 'w'
ax.errorbar(_x, _y, yerr=_yerr, marker='o', elinewidth=0.5, lw=0, c=c, markersize=2)
ax.update({ 'xlabel': r'x [units]', 'ylabel': r'y [units]' })
ax.legend(fontsize='small')
return fig
if __name__ == '__main__':
styles = ['clean', 'science', 'clean_wob', 'science_wob']
for style in styles:
set_style(style)
fig = make_plot(style)
fig.savefig(f'../results/plot_{style}.png', bbox_inches='tight', dpi=400)
mpl.rc_file_defaults()
Metadata
Release files for aesthetic 0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| aesthetic-0.11.tar.gz | 8.4 kB | Without provenance | Details for aesthetic-0.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aesthetic-0.11-py3-none-any.whl | Python 3 | none | any | Details for aesthetic-0.11-py3-none-any.whl |
Total release size: 18.9 kB
Release files / aesthetic-0.11.tar.gz
| Download URL | aesthetic-0.11.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09c69e2845794a6f904a1f618c51309752c91085e7d5bf193e74ee2b54095902
|
|
BLAKE2b-256 checksum How to use checksums |
7bacc4f64d8c5cedf1c0c2ed5106eed0291f36ca1119eeb4cf7d1a00f3971d79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / aesthetic-0.11-py3-none-any.whl
| Download URL | aesthetic-0.11-py3-none-any.whl |
|---|---|
| Size | 10.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0fac9142417f30907473f8ac3fcec0d0bee3f527632174cee41012bf8414eab
|
|
BLAKE2b-256 checksum How to use checksums |
68be963f3be96dc424e1b3d8539f9ac902797371573e1fb755b1bc782724f076
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for aesthetic 0.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.