adjustText
Iteratively adjust text position in matplotlib plots to minimize overlaps
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 adjusttextuv
uv add adjusttextpoetry
poetry add adjusttextInstalling 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
Tags
More Visualization packages
matplotlib creates static, animated, and…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
plotlyPlotly is an interactive, browser-based…
permissive · top 1,000 on PyPI
graphvizGenerates DOT language source code for graph…
permissive · top 1,000 on PyPI
streamlitStreamlit transforms Python scripts into…
permissive · top 1,000 on PyPI
leatherLeather is a lightweight Python charting…
permissive · top 1,000 on PyPI
japanize-matplotlibEnables matplotlib to display Japanese text in…
permissive · top 15,000 on PyPI
lovelyplotsLovelyPlots provides matplotlib style sheets…
permissive · top 15,000 on PyPI
matplotlib-fontjaEnables Japanese text rendering in matplotlib…
permissive · top 15,000 on PyPI
UpSetPlotUpSetPlot generates visualizations of set…
permissive · top 15,000 on PyPI
termplotlibtermplotlib renders line plots, histograms, and…
copyleft · top 15,000 on PyPI
plotnineplotnine implements a grammar of graphics for…
permissive · top 5,000 on PyPI
koreanize-matplotlibAutomatically configures matplotlib to display…
permissive · top 15,000 on PyPI
rectangle-packerPacks a set of rectangles with fixed…
permissive · top 15,000 on PyPI
mplcursorsAdds interactive point-selection cursors to…
unclear · top 5,000 on PyPI
matplotlib-scalebarAdds a matplotlib artist that renders a…
permissive · top 15,000 on PyPI