Matplotlib template for SuperMongo (SM) style. Make your plots stylish and professional (and old-school) by one line of code.
SuperMongo is a plotting software that was widely used in astronomy. It is known for its distinctive, high-contrast, and "classy" look, featuring Hershey fonts and a specific color palette. This package aims to reproduce that nostalgic style using Matplotlib, bringing the "retro" look to your modern Python workflow.
pip install smplotlibor
git clone
cd smplotlib
pip install -e . --user@software{jiaxuan_li_2023_8126529,
author = {Jiaxuan Li},
title = {AstroJacobLi/smplotlib: v0.0.9},
month = jul,
year = 2023,
publisher = {Zenodo},
version = {v0.0.9},
doi = {10.5281/zenodo.8126529},
url = {https://doi.org/10.5281/zenodo.8126529},
}
import smplotlibThen just use matplotlib.pyplot as usual. The package automatically applies the SuperMongo style, including the authentic color cycle (Standard X11 colors) and the classic jet colormap.
For a quick start, you can use smplotlib.demo_plot() to generate a figure with the default settings. We also provide demo scripts in src/smplotlib/demo.py and src/smplotlib/demo_astro.py which generate the figures below.
The left 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.
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.
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.
If you find this package entertaining or useful, please consider citing it following the instructions in .


