PingPlot
Visualize ping latency as a graph with CLI-compatible output.
Features
- ASCII Graph: Display latency over time in the terminal with extended ASCII line drawing
- Histogram: ASCII histogram of latency distribution
- Image Output: Generate professional PNG graphs with matplotlib
- Multiple Output Formats: ASCII, histogram, JSON, CSV, and PNG image
- Statistics: Min, max, average latency, and packet loss
- Customizable: Control ping parameters, graph dimensions, and figure size
- Cross-platform: Works on Linux, macOS, and Windows
- Continuous mode: Run indefinitely until interrupted (Ctrl+C)
- Config file: Persistent defaults via
~/.config/pingplot/config.toml
Installation
From PyPI (recommended)
With Image Support
pip install "pingplot[image]"
From Source
git clone https://github.com/themactep/pingplot
cd pingplot
pip install -e .
# With image support:
pip install -e ".[image]"
Development Install
Usage
Basic Usage (ASCII Graph)
With Custom Ping Parameters
pingplot 192.168.88.101 -c 100 -i 0.1 -s 1400
Continuous Mode
pingplot 192.168.88.101 -f
# Or with live updating ASCII graph:
pingplot 192.168.88.101 -f --format ascii
Output Formats
ASCII Graph (default):
pingplot 192.168.88.101 --format ascii --height 20 --width 80
Histogram:
pingplot 192.168.88.101 --format histogram
Image Output (PNG):
pingplot 192.168.88.101 --format image
pingplot 192.168.88.101 --format image -o my_ping_graph.png
pingplot 192.168.88.101 --format image --figsize 14,8
JSON Output:
pingplot 192.168.88.101 --format json
CSV Output:
pingplot 192.168.88.101 --format csv
Options
host: Target host to ping (or set default in config)
-c, --count: Number of ping packets (default: 100)
-i, --interval: Interval between packets in seconds (default: 0.1)
-s, --size: Packet size in bytes (default: 1400)
-t, --timeout: Command timeout in seconds (default: 300)
-f, --continuous: Run continuously until interrupted (Ctrl+C)
--format: Output format: ascii, histogram, json, csv, or image (default: ascii)
--height: Graph height for ASCII output (default: 20)
--width: Graph width for ASCII/histogram output (default: 80)
-o, --output: Output file path for image format (default: pingplot_HOST.png)
--figsize: Figure size for image output as 'width,height' (default: 12,6)
Configuration
Create ~/.config/pingplot/config.toml to set persistent defaults:
[defaults]
host = "192.168.88.101"
count = 50
interval = 0.2
size = 64
format = "ascii"
height = 25
width = 100
Then run without arguments:
Example Output
ASCII Graph Output
Latency Graph (min: 16.80ms, max: 25.50ms, avg: 19.69ms, lost: 0)
┌────────────────────────────────────────────────────────────────────────────────┐
25.50ms│ █ │
│ █▇ │
│ ▃ ██ │
│ █ ██ │
│ █ ██ ▇ │
│ █ ██ █ ▅ ▆ ▁ │
│▄ ██ ██ █ █ █ ▆ █ │
│█▅ ██ ██ █ ▄█ █ █ █ │
│██ ██ ██ ▃ █ ██▂█ ▆ ▇ █ █ │
│██▇ ██ ▁ ██ █ █ ▅ █ ████▇ █▁▃█ █▅ █ │
│███▁ ██▄ █ ██ █ ▄█ ▄▄█ ▅█ █████ ████▄██ ▅█▆▄ │
│████▅▅███ █▆▃██▅█▁ ██ ███ ██▄█████▄███████ █████ │
│█████████▄████████ ██▅███ █████████████████▃██████ │
│██████████████████ ██████▇████████████████████████ │
16.80ms│██████████████████████████████████████████████████ │
└────────────────────────────────────────────────────────────────────────────────┘
Time →
Image Output (PNG)
./pingplot.py 192.168.88.101 --format image

Requirements
- Python 3.8+
ping command available on system
- Appropriate permissions to run ping (may require sudo on some systems)
matplotlib (optional, required for image output)