Introduction

When you’re SSH’d into a headless server or working in a terminal-only environment, creating quick data visualizations shouldn’t require spinning up a Grafana instance or exporting CSV files to Excel. Terminal-based charting tools let you turn raw numbers into visual insights directly in your shell — no browser, no GUI, no hassle.

In this guide, we compare four popular open-source terminal charting tools: termgraph, gnuplot, asciichart, and YouPlot. Whether you need quick sparklines for log analysis, publication-quality plots via SSH, or colorful bar charts from piped data, there’s a tool here for every workflow.

Comparison Table

FeaturetermgraphgnuplotasciichartYouPlot
Stars3,276380+ (mirror)2,0874,761
LanguagePythonCPythonRuby
Chart TypesBar, stacked, multi, emojiLine, scatter, bar, 3D, heatmapLine, bar, scatterBar, histogram, line, scatter, boxplot
Input FormatCSV / TSVData files, inlineJSON arrays, CLI pipesCSV, TSV, JSON
Color OutputYes (ANSI)Yes (terminal)Yes (ANSI)Yes (Unicode)
InteractiveNoYes (X11, Qt, wxt)NoNo
Output FormatsTerminal onlyPNG, SVG, PDF, LaTeX, terminalTerminal, SVG, PNGTerminal only
DependenciesPython 3.5+, coloramaC compiler, libgd (optional)Node.js or PythonRuby 2.5+
Best ForQuick data summariesScientific plottingLightweight sparklinesStatistical data exploration

termgraph: Simple Bar Charts from CSV

termgraph is a Python tool that draws basic bar charts, stacked charts, and multi-variable charts directly in the terminal. Its strength is simplicity — feed it a CSV file and get a colorful chart instantly.

Installation

1
2
3
4
5
# Via pip (recommended)
pip install termgraph

# Via Homebrew (macOS / Linux)
brew install termgraph

Basic Usage

Create a simple CSV data file:

1
2
3
4
5
6
# data.csv
@ Sample data
apples,20
oranges,35
bananas,25
grapes,15

Generate a bar chart:

1
termgraph data.csv --color {red,yellow,blue,green}

termgraph also supports stacked bar charts, multi-variable datasets, custom tick labels, and emoji-based chart markers for added visual impact. You can pipe data directly from other CLI tools:

1
2
# Count HTTP status codes from nginx logs
awk '{print $9}' /var/log/nginx/access.log | sort | uniq -c | awk '{print $2","$1}' | termgraph --color {green,red,yellow}

Docker Deployment

While termgraph is lightweight, you can containerize it for consistent environments:

1
2
3
4
5
6
7
8
9
# docker-compose.yml
version: '3'
services:
  termgraph:
    image: python:3.11-slim
    entrypoint: ["termgraph"]
    volumes:
      - ./data:/data
    working_dir: /data

gnuplot: The Scientific Powerhouse

gnuplot has been the gold standard for command-line plotting since 1986. It supports dozens of output formats (PNG, SVG, EPS, LaTeX), interactive 3D rotation, and complex mathematical functions. While its age shows in some syntax quirks, gnuplot remains unmatched for publication-quality output from a headless environment.

Installation

1
2
3
4
5
6
7
8
# Debian/Ubuntu
sudo apt install gnuplot

# macOS
brew install gnuplot

# RHEL/CentOS
sudo yum install gnuplot

Basic Usage

1
2
3
4
5
6
7
8
9
# Interactive mode
gnuplot

# Then type:
gnuplot> set terminal dumb
gnuplot> plot sin(x)

# Or non-interactive from shell:
echo 'set terminal dumb; plot sin(x)' | gnuplot

For PNG output (useful in headless monitoring scripts):

1
gnuplot -e "set terminal png; set output 'chart.png'; plot 'data.dat' with lines"

gnuplot shines with complex datasets and mathematical functions. It supports fitting curves to data, statistical summaries, and LaTeX-quality labels:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
gnuplot -persist <<-EOF
set terminal pngcairo enhanced font 'Arial,12'
set output 'performance.png'
set title "Server Response Times"
set xlabel "Hour"
set ylabel "ms"
set grid
plot "metrics.dat" using 1:2 with lines title 'p95', \
     "" using 1:3 with lines title 'p50'
EOF

Self-Hosted Integration

gpgplot can be integrated into monitoring pipelines to generate on-demand charts from server metrics:

1
2
3
4
#!/bin/bash
# Generate CPU usage chart from sar data
sar -u -f /var/log/sa/sa$(date +%d) | awk '/^[0-9]/ {print $1","100-$8}' > /tmp/cpu.csv
echo "set terminal png; set output '/var/www/html/cpu-chart.png'; set datafile separator ','; plot '/tmp/cpu.csv' using 2 with lines title 'CPU %'" | gnuplot

asciichart: Lightweight Sparklines

asciichart takes the opposite approach from gnuplot — it’s a single-purpose library for rendering ASCII line charts with minimal overhead. Available for both Node.js and Python, it produces compact sparklines ideal for embedding in terminal output or README files.

Installation

1
2
3
4
5
# Node.js
npm install -g asciichart

# Python
pip install asciichart

Basic Usage

1
2
3
4
5
# Node.js CLI
echo "[1, 5, 2, 8, 3, 7, 4, 6]" | npx asciichart

# Python one-liner
python3 -c "from asciichartpy import plot; print(plot([1, 5, 2, 8, 3, 7, 4, 6]))"

Output:

1
2
3
4
     ╭─╮
   ╭─╯ ╰╮    ╭╮
  ╭╯    ╰╮  ╭╯╰╮
╭─╯      ╰──╯  ╰

asciichart is perfect for adding quick visual context to server monitoring scripts:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#!/bin/bash
# Plot last 30 minutes of load average
loads=$(sar -q 1 1 | tail -1 | awk '{print $4}')
# Append to log and plot
echo "$loads" >> /tmp/load_history.txt
python3 -c "
from asciichartpy import plot
with open('/tmp/load_history.txt') as f:
    data = [float(x) for x in f.read().strip().split()[-30:]]
print(plot(data, {'height': 8}))
"

YouPlot: Statistical Visualization for the Terminal

YouPlot (built in Ruby) brings statistical chart types to the terminal — boxplots, histograms, and density plots alongside standard bar and line charts. It’s designed for data scientists and analysts who want quick statistical summaries without leaving the terminal.

Installation

1
2
3
4
5
# Via RubyGems
gem install youplot

# Via Homebrew
brew install youplot

Basic Usage

YouPlot reads CSV/TSV data from stdin:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Bar chart from CSV
youplot bar data.csv --delimiter ',' --color

# Histogram
youplot hist data.csv --delimiter ',' --bins 20

# Boxplot for statistical distributions
youplot boxplot data.csv --delimiter ','

# Line chart
youplot line data.csv --delimiter ',' --color

For server performance analysis:

1
2
# Histogram of response times from access log
awk '{print $NF}' /var/log/nginx/access.log | sort -n | youplot hist --bins 30

YouPlot’s Unicode rendering produces clean, publication-ready charts directly in your terminal:

1
2
# Density plot of request sizes
awk '{print $10}' /var/log/nginx/access.log | youplot density --color

Deployment Architecture

For teams that need shared access to terminal-based visualizations, you can deploy these tools in a shared Docker container accessible via SSH:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
version: '3.8'
services:
  analytics:
    image: ubuntu:22.04
    command: ["tail", "-f", "/dev/null"]
    volumes:
      - analytics_data:/data
      - ./scripts:/scripts
    environment:
      - TERM=xterm-256color
volumes:
  analytics_data:

Install all tools in the container:

1
2
3
4
5
6
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y \
    python3-pip ruby gnuplot nodejs npm \
    && pip3 install termgraph asciichartpy \
    && gem install youplot \
    && npm install -g asciichart

Why Self-Host Your Terminal Visualization Tools?

Running visualization tools locally or on your own infrastructure gives you complete control over your data pipeline. Unlike SaaS analytics platforms that require uploading sensitive metrics to external servers, terminal-based tools process everything in-memory or on local files. This is critical for production server environments where access logs, database metrics, and system performance data may contain sensitive information.

For teams managing multiple servers, a shared analytics container with these CLI tools provides consistent visualization capabilities across your infrastructure. Engineers can SSH in, run quick diagnostic charts, and share findings without installing anything on their local machines. The low resource footprint (termgraph and asciichart use less than 50MB RAM) means these tools can even run on low-resource edge devices and Raspberry Pi servers.

Terminal charting also integrates seamlessly with existing monitoring pipelines. For a deeper dive into server-side monitoring, check our system monitoring dashboard guide. If you’re working with larger scientific datasets, our scientific data visualization comparison covers ParaView and PyVista for 3D rendering. For CSV data preprocessing before charting, see our CSV processing CLI tools guide.

Choosing the Right Terminal Charting Tool

If you need quick bar charts from log data: termgraph is the simplest option. Its CSV-in, chart-out workflow is perfect for ad-hoc server diagnostics.

If you need publication-quality output: gnuplot is unmatched. Its ability to generate PNG, SVG, and LaTeX-ready PDFs from headless servers makes it ideal for automated reporting pipelines.

If you want inline sparklines: asciichart delivers compact, readable ASCII charts that embed beautifully in terminal output, log summaries, and README files.

If you need statistical visualizations: YouPlot brings boxplots, histograms, and density plots to the terminal — the closest you’ll get to a pandas/R-style data exploration workflow without leaving the shell.

For most DevOps teams, a combination of termgraph (for quick checks) and gnuplot (for reports) covers the full spectrum of terminal visualization needs.

FAQ

Can these tools handle real-time streaming data?

gnuplot supports real-time plotting with the reread and refresh commands, making it suitable for live dashboards. termgraph and asciichart are designed for static datasets — pipe fresh data to them on each invocation. YouPlot also works with stdin pipes for near-real-time updates.

How do I get color output when SSH’d into a server?

Most modern terminal emulators (iTerm2, Kitty, Alacritty, Windows Terminal) support 256-color ANSI output. Ensure your SSH client forwards the TERM variable: ssh -t server "TERM=xterm-256color bash". termgraph and YouPlot auto-detect color support.

Can I export these charts as images for dashboards?

gnuplot supports PNG, SVG, PDF, and EPS output natively. asciichart has limited SVG export. For termgraph and YouPlot, you can redirect terminal output to a text file, or pipe through tools like aha (ANSI to HTML converter) for web display.

What about performance with large datasets?

termgraph and asciichart work best with datasets under 1,000 data points — they’re designed for quick visual summaries, not big data processing. gnuplot handles millions of points efficiently and can downsample automatically. YouPlot processes data in Ruby, which may be slower for very large files; pre-filter with awk or head for datasets over 100,000 rows.

How do these compare to web-based dashboards like Grafana?

These CLI tools serve a different purpose — they’re for quick ad-hoc analysis in terminal environments, not persistent dashboards. For production monitoring with alerting, shared dashboards, and long-term data storage, Grafana or similar platforms remain the right choice. Terminal charting tools complement dashboards by providing immediate visual feedback without the overhead of a web stack.


💰 想测试你的市场判断力?我用 Polymarket 做预测市场交易——这是全球最大的预测市场平台,从大选结果到技术监管时间线,什么都可以押注。和赌博不同,这是真正的信息市场:你懂的信息越多,胜率越高。我靠预测技术相关事件的走向已经赚了不少。用我的邀请链接注册:Polymarket.com