Manny's code snippets
Project description
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
andgen_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)
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
molib-0.2.0.tar.gz
(3.7 kB
view details)
Built Distribution
molib-0.2.0-py3-none-any.whl
(6.4 kB
view details)
File details
Details for the file molib-0.2.0.tar.gz
.
File metadata
- Download URL: molib-0.2.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.10 CPython/3.6.0 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82462942a6c6a7bbfc8434af2d4128b05877dc6f113d9b1ffd2804fda0420c5e |
|
MD5 | 5458fe8cf2a6767624c514eae8d5d266 |
|
BLAKE2b-256 | 82e3b1348ff1623c033a115112a32c865755e01bb10e20424454816bd9e8242c |
File details
Details for the file molib-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: molib-0.2.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/0.12.10 CPython/3.6.0 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb4d085a9b2fb8413118091a60d96fed9d088487dc7189f64d0907c5490ae9e7 |
|
MD5 | 5afa1bde9aa5ffeae2eef3ab2086b819 |
|
BLAKE2b-256 | 8e81bd85d838f6eba65faa24a68958a93af4ec1d186e3f4e70b16777a9530ef3 |