Skip to main content

No project description provided

Project description

plotannot

PyPI Version

Introduction

plotannot is a a python package to automatically highlight and adjust overlapping ticklabels in matplotlib/seaborn plots.

This package started as the need of ComplexHeatmap (R package) style annotations for Python plots but is also created with great inspiration and appreciation of the statannot package (webermarcolivier/statannot - now maintained at trevismd/statannotations), as well as the adjustText package (Phlya/adjustText).

Features

  • Add annotation lines for certain row/column labels
  • Shift labels to not overlap
  • Add additional highlights such as color, fontsize, etc. to certain row/column labels

Getting started

Install from PyPI:

pip install plotannot

Or directly from github:

pip install git+git://github.com/msbentsen/plotannot

Requirements for package:

  • Python >= 3.6
  • matplotlib
  • numpy

Simple example

#Plot heatmap
ax = sns.heatmap(table, xticklabels=True, yticklabels=False)

#Rotate all labels
plotannot.format_ticklabels(ax, axis="xaxis", rotation=45)

#Annotate labels
to_label = range(20,35)
plotannot.annotate_ticks(ax, axis="xaxis", labels=to_label) 

#Color individual labels
plotannot.format_ticklabels(ax, axis="xaxis", labels=[25], color="red")

Additional examples are found in the examples notebook.

Documentation and help

Documentation of the main functions are found at:

Issues and PRs are very welcome - please use the repository issues to raise an issue/contribute.

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

plotannot-0.1.0.tar.gz (704.4 kB view details)

Uploaded Source

File details

Details for the file plotannot-0.1.0.tar.gz.

File metadata

  • Download URL: plotannot-0.1.0.tar.gz
  • Upload date:
  • Size: 704.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.8

File hashes

Hashes for plotannot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 47a64627cfcecb00d3c510b6664ffc8815ed6d846ebd7efd1f7854d95a1049c1
MD5 36ad4cbc6c5c2fbd0fe7d29b581079b4
BLAKE2b-256 5ea7ce577cf8971211a28d62971915b3ab076937907541c07f21d8efe6e5d8d3

See more details on using hashes here.

Supported by

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