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.
The package is available on PyPI, and conda, with the latest source code available on gitlab.
To install the package from PyPI, run:
pip install plot-miscThis installs the latest stable release along with its dependencies.
A Conda package is maintained in my personal Conda channel. To install from this channel, run:
conda install afschmidt::plot-miscIf 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-miscInstall the dependencies:
# From the root of the repository
conda env create --file ./resources/conda/envs/conda_create.yamlTo add to an existing environment use:
# From the root of the repository
conda env update --file ./resources/conda/envs/conda_update.yamlNext the package can be installed:
make installFor development work, install the package in editable mode with Git commit hooks configured:
make install-devThis 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.pyWhen 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 -helpFor 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
}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 testsPlease have a look at the examples in resources for some possible recipes.