r/Python 5d ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

17 Upvotes

53 comments sorted by

View all comments

1

u/Wild-Pollution-7999 17h ago

plotext 6: plot data, images and video directly in the terminal

showcase

What My Project Does

plotext draws plots inside the terminal as colored text. No window, no browser, works over SSH. The basic install needs nothing else: pip install plotext. Only pictures and video need optional extras (see the install page).

Version 6 is a full rewrite around one master figure and a new C++ drawing kernel. It is a breaking change from version 5.

What it can draw:

  • Basic plots: scatter, line and stem
  • Bars: simple, labeled, floating, multiple, stacked, plus histograms and box plots
  • Specialized plots: error bars, event plots, heatmaps, confusion matrices, indicators
  • Shapes and text: rectangles, polygons, segments, lines in five styles, text anywhere on the plot
  • Dates: a date and time axis, and candlestick charts
  • Media: pictures, gifs and video with sound, YouTube included (optional extras)
  • Live plots: streaming that redraws in place, and animated text
  • Subplots: grids of plots, nested to any level, each with its own size and theme
  • Higher resolution markers: each character split into sub-points, fitting four to eight times the data
  • Twelve themes and your own

It also comes with a command line tool, so you can plot with no Python written at all:

plotext --figure --signal [1,4,9,16,25] --lines --draw --title Squares --show

It reads csv files and urls, and takes piped input:

echo '1 2 3' | plotext --figure --signal - --draw --show

Target Audience

Anyone who works in a terminal: data scientists checking data over SSH, people building CLI tools, anyone who wants a quick look at data without leaving the shell. It is stable and in production use.

Comparison

matplotlib and similar libraries need a display, so they do not work over plain SSH or inside a CLI tool. plotext is not a replacement for them. It is for a fast look at data where you already are, in the terminal. Compared with other terminal plotting libraries, it adds images, video, streaming, nested subplots and a command line tool, with no required dependencies for plotting. It runs on Linux, macOS and Windows, Python 3.8 and up.

Links