Skip to main content

Documentation Status Mutable.ai Auto Wiki 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!

Release files for adjustText 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adjustText 1.4.0
File Size Uploaded
adjusttext-1.4.0.tar.gz 15.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adjustText 1.4.0
File Interpreter ABI Platform
adjusttext-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size:29.1 kB

Release files / adjusttext-1.4.0.tar.gz

Download URL adjusttext-1.4.0.tar.gz
Size 15.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1f73860ced8cccce3f85ee6989ca133c2579b67a7453f63dbeb38f39bf123154
BLAKE2b-256 checksum
How to use checksums
b55c496e506ad3313664df24a79f801719cadcd62af5999fcb299c9b08ff0d4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / adjusttext-1.4.0-py3-none-any.whl

Download URL adjusttext-1.4.0-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6febd6484c0d45c39a22f44b2c1f4a8cd01ef58fada565cab4b629c771df79b5
BLAKE2b-256 checksum
How to use checksums
b82c897bdd17b05724c894a5b831c6b2e9853adcc2d07a70d6246c0cd5cd3912
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

3 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.1

2 release files

1.0

2 release files

0.8

2 release files

0.7.3

1 release file

0.7.2

1 release file

0.7

2 release files

0.6.3

1 release file

0.6.2

2 release files

0.6.1

1 release file

0.6.0

1 release file

0.5.3

1 release file

0.5.2

2 release files

0.5.1

1 release file

0.5

1 release file

0.3

1 release file

0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page