whatisgithub

What is curved-text?

thiebes/curved-text — explained in plain English

Analysis updated 2026-05-18

29PythonAudience · dataComplexity · 1/5LicenseSetup · easy

In one sentence

curved-text is a Python library that draws text labels directly onto matplotlib curves, with each character rotated to follow the line's shape.

Mindmap

mindmap
  root((curved-text))
    What it does
      Labels curves directly
      Rotates text along a line
      Supports math notation
    Tech stack
      Python
      matplotlib
    Use cases
      Chart labeling
      Data visualization
      Scientific plots
    Audience
      Data users

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Label a plotted line directly on the chart instead of using a separate legend box.

USE CASE 2

Position a label at any point along a curve using a simple 0 to 1 fraction.

USE CASE 3

Render mathematical expressions, like fractions or square roots, curved along a plotted line.

USE CASE 4

Keep curve labels correctly placed when a matplotlib chart is resized, panned, or zoomed.

What is it built with?

Pythonmatplotlib

How does it compare?

thiebes/curved-textadityasharmadotai-hash/docs-reader-rag-agentalekseiul/hermes-researcher-agent
Stars292929
LanguagePythonPythonPython
Setup difficultyeasyeasymoderate
Complexity1/52/52/5
Audiencedatavibe coderresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Install via pip, works with any library built on matplotlib, including seaborn and pandas.

MIT license. Free to use, modify, and share, including commercially, as long as you keep the copyright notice.

So what is it?

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.

Copy-paste prompts

Prompt 1
Show me how to add a curved label to a matplotlib line plot using curved-text.
Prompt 2
Explain the difference between the pos, anchor, and offset parameters in curved-text.
Prompt 3
How do I render a mathematical expression as a curved label on my chart?
Prompt 4
Walk me through using curved-text with a seaborn or pandas plot.

Frequently asked questions

What is curved-text?

curved-text is a Python library that draws text labels directly onto matplotlib curves, with each character rotated to follow the line's shape.

What language is curved-text written in?

Mainly Python. The stack also includes Python, matplotlib.

What license does curved-text use?

MIT license. Free to use, modify, and share, including commercially, as long as you keep the copyright notice.

How hard is curved-text to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is curved-text for?

Mainly data.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.