Label a plotted line directly on the chart instead of using a separate legend box.
Position a label at any point along a curve using a simple 0 to 1 fraction.
Render mathematical expressions, like fractions or square roots, curved along a plotted line.
Keep curve labels correctly placed when a matplotlib chart is resized, panned, or zoomed.
| thiebes/curved-text | adityasharmadotai-hash/docs-reader-rag-agent | alekseiul/hermes-researcher-agent | |
|---|---|---|---|
| Stars | 29 | 29 | 29 |
| Language | Python | Python | Python |
| Setup difficulty | easy | easy | moderate |
| Complexity | 1/5 | 2/5 | 2/5 |
| Audience | data | vibe coder | researcher |
Figures from each repo's GitHub metadata at analysis time.
Install via pip, works with any library built on matplotlib, including seaborn and pandas.
curved-text is a Python library that lets you place text labels directly on plotted curves in matplotlib charts, with each character individually rotated to follow the line. The common alternative is a legend box off to the side, which requires the reader to look away from the data to figure out which color corresponds to which series. Direct labeling keeps the eye on the chart, and this library makes it possible for labels to travel along any shape of line, not just straight segments. Three parameters control placement. The pos parameter sets where along the curve the label is anchored, expressed as a fraction from 0.0 (the start of the line) to 1.0 (the end). The anchor parameter controls which part of the label text lands at that position: the beginning, center, or end of the string. The offset parameter shifts the text perpendicularly away from the curve by a given number of typographic points, so the label floats above or below the line rather than sitting on top of it. The library also supports matplotlib's mathtext notation, which lets you write mathematical expressions using dollar-sign delimiters. Fractions, square roots, subscripts, and other symbols are rendered and then bent to follow the curve like regular text. A box option draws a filled band behind the label to keep it readable where it crosses over other lines in the chart. Because the label positions are recalculated on every draw event, they stay correct when the chart is resized or when a user pans and zooms in an interactive matplotlib session. The library works with any library built on matplotlib, including seaborn and pandas, since those all ultimately produce standard matplotlib axes objects. Installation is via pip with the package name curved-text. The repository includes examples showing the placement controls, overrun behavior when a label extends past the end of a curve, and integration with seaborn and pandas. The license is MIT.
curved-text is a Python library that draws text labels directly onto matplotlib curves, with each character rotated to follow the line's shape.
Mainly Python. The stack also includes Python, matplotlib.
MIT license. Free to use, modify, and share, including commercially, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly data.
This repo across BitVibe Labs
Verify against the repo before relying on details.