# ttyplot: realtime terminal charts from standard input

> ttyplot is a C command-line utility that reads numeric samples from standard input and draws realtime charts in a text terminal. It suits system administrators, developers, and monitoring users who want a quick view from commands such as ping, vmstat, snmpget, and iostat.

**tenox7/ttyplot** — a realtime plotting utility for terminal/console with data input from stdin

- Repository: https://github.com/tenox7/ttyplot
- Stars: 1,384 · Forks: 51
- Language: C
- License: Apache-2.0
- Published: 2026-10-16 · Updated: 2026-10-16 · Language: en
- Canonical page: https://hysenlabs.com/projects/tenox7-ttyplot

## Why ttyplot fits Unix monitoring pipelines

ttyplot solves a narrow but common terminal problem: turning a stream of numeric output into a live text chart without moving the workflow into a graphical application. It is intended for users who work with Unix pipelines, including system administrators checking resource use, developers inspecting live counters, and users combining network or hardware commands with a console display. The README lists tools such as ping, snmpget, netstat, ip link, sar, vmstat, iostat, rrdtool, and node_exporter as possible upstream data sources.

The defining interface is standard input. A producer writes values to a pipe, and ttyplot reads those values and updates the terminal display. That makes composition with awk, sed, grep, cut, jq, and similar tools natural. It also means ttyplot does not need to define its own collectors or network protocol. The collection and field selection remain in the upstream command and text-processing pipeline.

This design is appropriate for observation, not long-term analytics. Those missing capabilities are important boundaries when selecting the utility.

## The stdin plotting and rate-calculation model

In its basic mode, the pipeline writes one numeric sample per line and ttyplot draws that value as a realtime point. Labels and units are supplied on the command line. For example, the ping example extracts the response time from ping output, while the CPU example transforms vmstat output into a percentage before invoking ttyplot. ttyplot receives only the resulting numeric stream, so parsing the source system's format remains outside the plotting utility.

For counter metrics, the documented `-r` option asks ttyplot to calculate a rate from differences between samples measured in time. The repository examples apply this mode to SNMP octet counters collected with snmpget, byte counters collected from `ip link`, and disk counters exposed by node_exporter. The producing loop applies `sleep`, and ttyplot derives the rate from the timing between counter readings.

Two-line graphs use `-2`. This suits paired series such as received and transmitted bytes or disk reads and writes. In the snmpdelta example, `awk` prints the final field of two counter rows, and `ttyplot -2` places the pair on the displayed graph. The README also describes color selection with `-C` and experimental braille and block-element rendering. Those presentation options expand terminal rendering choices without changing the core stdin model.

## Installing ttyplot on Linux, macOS, and BSD systems

The README lists package-manager installation for several platforms. Choose the command that matches the system rather than combining commands. A package installation is the shortest documented route and leaves source-build details out of the initial setup.

On Ubuntu with Snap support, install the published package as follows. The command should complete by installing the package from the Snap store:

```bash
snap install ttyplot
```

On Debian, the documented package command is:

```bash
apt install ttyplot
```

For macOS, Homebrew installs the package:

```bash
brew install ttyplot
```

Gentoo, Termux, and FreeBSD have documented alternatives:

```bash
emerge -av app-admin/ttyplot
```

```bash
pkg install ttyplot
```

The FreeBSD and Termux examples use the same `pkg` command but apply to their respective systems. For other platforms, the README directs users to the repository's releases tab or the older 1.4 release. It does not publish a single cross-platform installer command for those cases.

## Building version 1.7.6 from the repository

The repository includes a Makefile and C sources for `ttyplot` and `stresstest`. Its build uses `pkg-config` to locate `ncursesw`, enables `-Wall -Wextra`, and links the math library. The default Makefile version is 1.7.6. The following command builds the default targets:

```bash
make
```

The default target produces `ttyplot` and `stresstest`. The executable depends on the system C compiler, `pkg-config`, and development files for ncursesw. The Makefile does not document a fallback when `pkg-config` cannot find ncursesw, so a source build requires those components to be present and discoverable before compilation can proceed.

The install target places the executable under the configured binary prefix and installs `ttyplot.1` under the configured man-page prefix. The default `PREFIX` is `/usr/local`, and installation can be redirected with the standard `DESTDIR` variable when packaging. The following command performs the documented local install:

```bash
make install
```

For package staging or a nonstandard prefix, the Makefile supports `DESTDIR`, `PREFIX`, and `MANPREFIX`. The README does not document a separate test target.

## Plotting ping latency as a first live use

A straightforward first use is a ping latency chart. The documented macOS command uses unbuffered `sed`, extracts the text after `time=`, removes the millisecond suffix, and sends the result to ttyplot:

```bash
ping 8.8.8.8 | sed -u 's/^.*time=//g; s/ ms//g' | ttyplot -t "ping to 8.8.8.8" -u ms
```

`ttyplot` should receive successive numeric latency values and update a terminal graph labeled `ping to 8.8.8.8`, with units shown as `ms`. The README notes that the `-u` spelling changes to `-l` on macOS for this example. That platform distinction matters because copying the command unchanged to a system with different output or option conventions can produce a broken pipeline.

The same command can assign terminal colors with the documented `-C` option:

```bash
ping 8.8.8.8 | sed -u 's/^.*time=//g; s/ ms//g' | ttyplot -t "ping to 8.8.8.8" -u ms -C 2,3,4,5
```

According to the README, color 2 colors the plot line, color 3 the axes, color 4 the text, and color 5 the title and messages. Color behavior depends on terminal capabilities, which the README does not define further.

## Buffering and paired-series constraints in upstream commands

The first practical failure point is usually the producer, not the chart renderer. The README explicitly calls out buffering in several examples. Its vmstat CPU example uses `gawk` and calls `fflush()`, while the Linux memory example wraps `grep`, `tr`, and `cut` with `stdbuf -o0`. These steps are intended to prevent standard I/O buffering from withholding values until a buffer fills or a process exits.

A live chart can therefore appear idle even though the upstream command is running if intermediate text-processing stages delay output. The collector must also emit values in a shape ttyplot can interpret. The examples consistently send numbers, and paired modes send two numbers where the documented input calls for two series. Ad hoc collectors that emit diagnostic lines, labels, timestamps, missing values, or multiple columns without conversion may not match that model.

The README cautions that its examples are not exhaustive or guaranteed to work in every environment. This is particularly relevant for commands whose schemas vary by operating system, such as ping, netstat, free, and wireless tools. The documented examples reduce that risk by placing extraction logic before ttyplot, but they do not guarantee portability of the upstream command itself.

## Alternative approaches and maintenance boundaries

A real alternative is a Unix pipeline that writes a text-based visualization directly, or a system monitoring program that owns collection, storage, and display. The difference is architectural. ttyplot is a rendering endpoint: it expects already-normalized numbers on standard input and does not provide the collectors, database, query layer, or browser interface associated with monitoring stacks. If the requirement is history, alerts, dashboards shared by several users, or long-term retention, a dedicated monitoring system is the more appropriate class of tool.

A simpler terminal sparkline renderer is another alternative when only the latest values matter and no axes, scale controls, units, or paired graphs are required. ttyplot's documented scope is more specific than a quick inline sparkline because it focuses on a continuously updated console plot, rate calculation, scaling, labels, and two-line output.

The repository is not archived, and its last push was on 2026-10-13. Release 1.7.6 is dated 2026-07-14, while 1.4.1 is explicitly marked as legacy. The project is licensed under Apache-2.0. That license permits use and modification under its conditions, but the repository does not provide legal interpretation. Upgrade planning should account for ncursesw linkage and changes in command-line behavior, rather than assuming that every release is operationally equivalent to 1.4.1.

## Conclusion

Adopt ttyplot for lightweight, interactive inspection when you already have a command that emits numeric samples and your terminal is the intended display. Do not choose it for saved interactive dashboards, richer charting, or long-term history when those requirements exceed its stdin-driven terminal model. Verify first that the upstream command emits one numeric value per line at an acceptable rate, that buffering does not delay samples, and that your installed ncursesw build supports the required terminal behavior.

## FAQ

### How do I install ttyplot?

The README lists `snap install ttyplot` for Ubuntu, `apt install ttyplot` for Debian, `brew install ttyplot` for macOS, and package commands for Gentoo, Termux, and FreeBSD. Other platforms are directed to the repository's releases tab.

### How do I make a chart from ping output?

Use the documented pipeline to extract the time value with `sed`, then send it to `ttyplot` with a title and millisecond unit. The README notes that the ping unit option differs on macOS.

### Can ttyplot calculate rates from counters?

Yes. The `-r` option calculates a rate by using the measured time difference between samples. The README demonstrates it with SNMP counters, `ip link` byte counters, and node_exporter disk counters.

### How does ttyplot display two data series?

Use `-2`, as shown in the SNMP throughput, disk throughput, and network-interface examples. The upstream pipeline prints paired values, and ttyplot displays them as a two-line graph.

### What dependencies are used to build ttyplot from source?

The Makefile uses `pkg-config` to obtain compile and link flags for ncursesw, and it links the math library. The default `make` target builds `ttyplot` and `stresstest`.

## Sources

- [Issues](https://github.com/tenox7/ttyplot/issues)
- [License: Apache-2.0](https://github.com/tenox7/ttyplot/blob/master/LICENSE)
- [README](https://github.com/tenox7/ttyplot/blob/master/README.md)
- [Releases](https://github.com/tenox7/ttyplot/releases)
- [tenox7/ttyplot on GitHub](https://github.com/tenox7/ttyplot)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/tenox7-ttyplot
