Skip to main content

Matplotlib template for SuperMongo style

Project description

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.

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

smplotlib-1.0.0.tar.gz (437.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smplotlib-1.0.0-py3-none-any.whl (431.4 kB view details)

Uploaded Python 3

File details

Details for the file smplotlib-1.0.0.tar.gz.

File metadata

  • Download URL: smplotlib-1.0.0.tar.gz
  • Upload date:
  • Size: 437.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for smplotlib-1.0.0.tar.gz
Algorithm Hash digest
SHA256 30dcdaf746e978d5f306c78a711b8b14f86e833e35b82f5a9bb11c9c0469d1c8
MD5 7e6eff005607192cd046f3a14dbbdd2c
BLAKE2b-256 3a3f93825537c5bcb5d31339fd714c6ee646866a0c4889c577a8f0eaec132377

See more details on using hashes here.

File details

Details for the file smplotlib-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: smplotlib-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 431.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for smplotlib-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9e41f1a8d03421f6526f4eebf271a8cfe8bf638bb0e946d1dcb9b28f3975c954
MD5 9ee9b442995a9889c8a6e72bb346efbf
BLAKE2b-256 a50408993e3375316bd4a7d79b5de1c1379c40101fcd4f742148f9c16f5f1f16

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page