Skip to main content

smplotlib

DOI Downloads PyPI version License: MIT

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.

example

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 DOI.

Metadata

Release files for smplotlib 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smplotlib 1.0.0
File Size Uploaded
smplotlib-1.0.0.tar.gz 437.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smplotlib 1.0.0
File Interpreter ABI Platform
smplotlib-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 869.3 kB

Release files / smplotlib-1.0.0.tar.gz

Download URL smplotlib-1.0.0.tar.gz
Size 437.9 kB
Tags Source
SHA-256 checksum
How to use checksums
30dcdaf746e978d5f306c78a711b8b14f86e833e35b82f5a9bb11c9c0469d1c8
BLAKE2b-256 checksum
How to use checksums
3a3f93825537c5bcb5d31339fd714c6ee646866a0c4889c577a8f0eaec132377
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release files / smplotlib-1.0.0-py3-none-any.whl

Download URL smplotlib-1.0.0-py3-none-any.whl
Size 431.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e41f1a8d03421f6526f4eebf271a8cfe8bf638bb0e946d1dcb9b28f3975c954
BLAKE2b-256 checksum
How to use checksums
a50408993e3375316bd4a7d79b5de1c1379c40101fcd4f742148f9c16f5f1f16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page