Skip to main content

Iteratively adjust text position in matplotlib plots to minimize overlaps

Project description

Documentation Status Gitter chat DOI PyPI version

adjustText - automatic label placement for matplotlib

Inspired by ggrepel package for R/ggplot2 (https://github.com/slowkow/ggrepel) Alt text

Alternative: textalloc https://github.com/ckjellson/textalloc

Brief description

The idea is that often when we want to label multiple points on a graph the text will start heavily overlapping with both other labels and data points. This can be a major problem requiring manual solution. However this can be largely automatized by smart placing of the labels (difficult) or iterative adjustment of their positions to minimize overlaps (relatively easy). This library (well... script) implements the latter option to help with matplotlib graphs. Usage is very straightforward with usually pretty good results with no tweaking (most important is to just make text slightly smaller than default and maybe the figure a little larger). However the algorithm itself is highly configurable for complicated plots.

Getting started

Installation

Should be installable from pypi:

pip install adjustText

Or with conda:

conda install -c conda-forge adjusttext 

For the latest version from github:

pip install https://github.com/Phlya/adjustText/archive/master.zip

Documentation

Wiki has some basic introduction, and more advanced usage examples can be found here.

Thanks to Christophe Van Neste @beukueb, adjustText has a simple documentation: http://adjusttext.readthedocs.io/en/latest/

Citing adjustText

To cite the library if you use it in scientific publications (or anywhere else, if you wish), please use the link to the GitHub repository (https://github.com/Phlya/adjustText) and a zenodo doi (see top of this page). Thank you!

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

adjustText-1.0.3.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

adjustText-1.0.3-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file adjustText-1.0.3.tar.gz.

File metadata

  • Download URL: adjustText-1.0.3.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for adjustText-1.0.3.tar.gz
Algorithm Hash digest
SHA256 f129b905e3c9964e14b503baf55f9044edb8581244ff2050f31e9e7e859aee3c
MD5 b1bb52aa90037ae4b97ebe4074853d6a
BLAKE2b-256 6958616ca4042ced5978dac710acf7da7bcbea9c512b200bdbc4ae389bbbf727

See more details on using hashes here.

File details

Details for the file adjustText-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: adjustText-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for adjustText-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6ff22ec39383cc3b60359d60b599484663dcdbf431fdde4cd510d2ab06f45f6c
MD5 905adedbe8e07d7963bbbd818c8305f3
BLAKE2b-256 b9dd0c2cea1ea82ed3d7ec50f8247db538a7ce12cfd95dfe63950c7233fc625c

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