skillfed

adjustText

Iteratively adjust text position in matplotlib plots to minimize overlaps

adjusttext v1.4.0 1.2M downloads/30d#4,211 on PyPI1,660
Permissive license MIT Active released

What it is and what it does

adjustText solves the common problem of overlapping text labels on matplotlib plots by iteratively repositioning them to minimize collisions. When plotting multiple labeled points, the default matplotlib text placement often results in unreadable overlaps; this package automates the tedious manual repositioning work by applying an algorithm that moves labels away from each other and data points while keeping them visually associated with their targets.

The package works as a post-processing step on an existing matplotlib figure: you create your plot normally, pass the text objects to adjustText's main function, and it adjusts their positions. It requires only numpy, matplotlib, and scipy as dependencies and is designed to work well with minimal configuration, though the algorithm is highly configurable for complex cases. The library is inspired by ggrepel for R and offers a simpler alternative to manual label placement.

Use it for:

  • Scatter plots with many labeled data points where default text placement causes heavy overlap
  • Scientific figures with annotations that need automatic repositioning to improve readability
  • Multi-point graphs where manual label adjustment would be time-consuming and error-prone
  • Publication-ready plots requiring clean, non-overlapping label layouts without manual tweaking

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Automatically repositions text labels on matplotlib plots to minimize overlaps with other labels and data points using iterative adjustment.

Yes. Low install friction, permissive MIT license, active maintenance, no known vulnerabilities, and solves a genuine matplotlib usability problem. Install if you regularly create labeled plots and want to avoid manual label repositioning.

Install

adjusttext on PyPI

pip

pip install adjusttext

uv

uv add adjusttext

poetry

poetry add adjusttext

Installing adjustText

Before you install

Low friction install with three common scientific dependencies (numpy, matplotlib, scipy). Actively maintained with recent releases; repository shows 1660 stars and current activity.

License in practice

MIT license permits use in proprietary and open-source projects with minimal restrictions; attribution required but no copyleft obligations.

Quickstart

pip install adjustText

import matplotlib.pyplot as plt
from adjustText import adjust_text

plt.scatter([1, 2, 3], [1, 2, 3])
texts = [plt.text(x, y, f'label{i}') for i, (x, y) in enumerate([(1,1), (2,2), (3,3)])]
adjust_text(texts)
plt.show()

Verify before relying

  • Whether the algorithm's performance scales well with very large numbers of labels (hundreds or thousands)
  • Specific configuration options available for tuning label placement behavior on complex plots

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 3 — numpy, matplotlib, scipy
Maintenance actively maintained — 67 days since the last release
Last repo commit
First released
Downloads 1,212,535/month — #4,211 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: adjusttext-1.4.0-py3-none-any.whl

Framework :: MatplotlibTopic :: Scientific/Engineering :: Visualization

Tags

matplotlib label overlap removalautomatic text placement matplotlibprevent overlapping labels plotslabel positioning matplotlibtext annotation adjustmentmatplotlib label collision detectionsmart label placement
matplotlib-pluginlabel-placementvisualization

More Visualization packages