Matplotlib template for SuperMongo style
Project description
smplotlib
Matplotlib template for SuperMongo (SM) style. Make your plots stylish and professional (and old-school) by one line of code.
Installation
pip install smplotlib
or
git clone
cd smplotlib
pip install -e . --user
Usage
import smplotlib
Then just use matplotlib.pyplot
as usual. For a quick start, you can use smplotlib.demo_plot()
to generate a figure with the default settings. This figure is inspired by the two-phase ISM figure in Prof. Bruce Draine's book, but the cooling curve doesn't correspond to the actual CR rates and ISRF.
More advanced usage
You can use the function smplotlib.set_style(fontweight='normal', usetex=False, fontsize=15, figsize=(6, 6), dpi=120)
to customize the global seetings including font weight, font size, default figure size and resolution, and whether using LaTeX for math. The default font weight is 'normal'
, and the default setting for LaTeX is False
. You can specify font weight as 'light'
or 'heavy'
. Current support for LaTeX is not quite satisfying, so it is recommended to set usetex=False
.
You can turn off the black edgecolor of scatter plots by smplotlib.set_style(edgecolor='face')
. This is useful when you want to plot a large number of points.
Hershey font
SuperMongo uses Hershey fonts. The ttf
files are from a compilation by astronomer yangcht
. Thanks for the great work!
There have been many efforts on translating the original Hershey font to modern formats, also see this and this. The font files in this repo still lack some characters, and the support for LaTeX and light weight fonts are not satisfying. If you have any suggestions, please feel free to open an issue or pull request.
Citation
If you find this package entertaining or useful, please consider citing it following the instructions in .
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
Built Distribution
File details
Details for the file smplotlib-0.0.9.tar.gz
.
File metadata
- Download URL: smplotlib-0.0.9.tar.gz
- Upload date:
- Size: 430.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aadd11038f9fc6cc7d75626e9d6957150d039f3691c72546d3fab4641206b436 |
|
MD5 | 0ac1d7e86aa9c87fb14b1f9cac507d14 |
|
BLAKE2b-256 | 63018f4729ef47ae3ab3c5356a80c981758fabeed3ba3f452fb6edb1da01c78e |
File details
Details for the file smplotlib-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: smplotlib-0.0.9-py3-none-any.whl
- Upload date:
- Size: 424.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22a36c75cf53c790f0f8aba17d687bc70b40ca5dda31455c38b387d53bdcf509 |
|
MD5 | eefd126c299be253c6f397138c35d210 |
|
BLAKE2b-256 | c1eb3d12792c4d17b0628379a642b20ce8807cf29bf3d132450949d1b9684ac8 |