Skip to main content

molib

This package contains functions that I keep re-using in different packages, so I decided to publish them, in case it helps other too.

Installation

To install molib, use pip (or similar):

pip install molib

Documentation

Figures

Add letter labels to all subplots in a figure.

label_subplots(fig, size=14)
  • Adjusts figure padding and left margin to make labels fit.
  • Uses add_subfig_label and gen_sub_label.

Add a subplot label to an axis.

add_subfig_label(ax, label, size=14)

Generate the next figure label.

gen_sub_label(lower=False, paren=False)
  • Produces the next letter in the alphabet as a subfig label.
  • Label can be uppercase or lowercase, with optional parentheses.

Save plots in a directory

save_plot(output_filename, proj_dir=Path.cwd(), subdir=None, fig=None)
  • Function for saving plots (active plot or given figure) and printing a console message.
  • Saves as a 300dpi png file.
  • Makes plots directory if it does not exist.
  • Directory name is customizable.

Colors

Rescale RGB to values between 0 and 1

rescale_colors(color_list)

Tableau 10 Colors

tableau10(index)

Tableau 20 Colors

tableau20(index)

Tableau Color Blind 10

tableau10blind(index)

Logging

Custom console logger

import logging
console_logger(logging.DEBUG)

Metadata

Release files for molib 0.3.1

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

Source distribution (sdist)

Source distribution for molib 0.3.1
File Size Uploaded
molib-0.3.1.tar.gz 4.3 kB Details

Built distribution (wheel)

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

Total release size: 12.4 kB

Release files / molib-0.3.1.tar.gz

Download URL molib-0.3.1.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
320d5906c803bb3790e56dcfbed6daf41c82d9df4344041a4bdfa5dea0af993e
BLAKE2b-256 checksum
How to use checksums
87141bd884d6a958f6ab4862676f87c1bd7e67622a30de3da4b9c716205dc982
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.11 CPython/3.7.2 Windows/10

Release files / molib-0.3.1-py3-none-any.whl

Download URL molib-0.3.1-py3-none-any.whl
Size 8.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c393d029dbe484e67ba6fc3eda9ef6035cbc5dd32d908870b6e23104f1d838c1
BLAKE2b-256 checksum
How to use checksums
80befc4aed4e69ad253b33d3e3eddf0a1d1fa246108ec3789a5a6624f6794c77
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.11 CPython/3.7.2 Windows/10

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

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