Skip to main content

Various plotting templates built on top of matplotlib

Project description

plot-misc icon

A collection of plotting functions

version: 2.2.2

This repository collects plotting modules written on top of matplotlib. The functions describe plotting archetypes intended to set up light-touch, illustrations that can be customised using the standard matplotlib interface via axes and figures. Because the implementation is matplotlib-first, the API is consistent with matplotlib conventions, and users already familiar with the library will find the learning curve minimal.

The functionality is geared towards illustrations commonly used in biomedical research:

  • Bar charts
  • Bubble charts
  • Forest plots (with optional side-tables)
  • Heatmaps (with optional annotations)
  • Incidence matrix plots
  • Machine learning plots (calibration, feature importance, net benefit)
  • Pie charts
  • Survival plots (with optional survival table)
  • Tree/compatibility plots
  • Volcano plots

Please consult the documentation for plot-misc.

Installation

The package is available on PyPI, and conda, with the latest source code available on gitlab.

Installation using PyPI

To install the package from PyPI, run:

pip install plot-misc

This installs the latest stable release along with its dependencies.

Installation using conda

A Conda package is maintained in my personal Conda channel. To install from this channel, run:

conda install afschmidt::plot-misc

Installation using gitlab

If you require the latest updates, potentially not yet formally released, you can install the package directly from GitLab.

First, clone the repository and move into its root directory:

git clone git@gitlab.com:SchmidtAF/plot-misc.git
cd plot-misc

Install the dependencies:

# From the root of the repository
conda env create --file ./resources/conda/envs/conda_create.yaml

To add to an existing environment use:

# From the root of the repository
conda env update --file ./resources/conda/envs/conda_update.yaml

Next the package can be installed:

make install

Development

For development work, install the package in editable mode with Git commit hooks configured:

make install-dev

This command installs the package in editable mode and configures Git commit hooks, allowing you to run git pull to update the repository or switch branches without reinstalling.

Alternatively, you can install manually:

python -m pip install -e .
python .setup_git_hooks.py

Git Hooks Configuration

When setting up a development environment, the setup-hooks command configures Git hooks to enforce conventional commit message formatting and spell check using codespell.

To view the commit message format requirements, run:

./.githooks/commit-msg -help

For frequent use, add this function to your shell configuration (~/.bashrc or ~/.zshrc):

commit-format-help() {
    local git_root
    git_root=$(git rev-parse --show-toplevel 2>/dev/null)
    
    if [ -z "$git_root" ]; then
        echo "Error: Not inside a git repository"
        return 1
    fi
    
    local hook_path="$git_root/.githooks/commit-msg"
    
    if [ ! -f "$hook_path" ]; then
        echo "Error: commit-msg hook not found"
        return 1
    fi
    
    "$hook_path" --help
}

Validating the package

After installing the package from GitLab, you may wish to run the test suite to confirm everything is working as expected:

# From the root of the repository
pytest tests

Usage

Please have a look at the examples in resources for some possible recipes.

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

plot_misc-2.2.2.tar.gz (142.1 kB view details)

Uploaded Source

Built Distribution

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

plot_misc-2.2.2-py3-none-any.whl (146.9 kB view details)

Uploaded Python 3

File details

Details for the file plot_misc-2.2.2.tar.gz.

File metadata

  • Download URL: plot_misc-2.2.2.tar.gz
  • Upload date:
  • Size: 142.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for plot_misc-2.2.2.tar.gz
Algorithm Hash digest
SHA256 ecb0e46d6c8ec4cde6a00d6fbbdf9b31b0da1c41c042a5ab2054f7c13e3c01d6
MD5 d4dd71c543f5439628eb87b681d50fbf
BLAKE2b-256 deb59b717e47edce836cbddfa65821194acf4734ea34ec84eb9e6078e1919bd7

See more details on using hashes here.

File details

Details for the file plot_misc-2.2.2-py3-none-any.whl.

File metadata

  • Download URL: plot_misc-2.2.2-py3-none-any.whl
  • Upload date:
  • Size: 146.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.0

File hashes

Hashes for plot_misc-2.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 db71b365b5c3959d300b9852b0b9c9309a5c18f0055e4ce8b9a9172432fe831a
MD5 c2a4a4e4a982816a2e262aa0b611e08a
BLAKE2b-256 5363e3b9518317b6d3fccd29b702e2e80e71c6644132c2b907707ca7c2c762a0

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