Gnuplot

From Segfault
Jump to navigation Jump to search

Installation

Gnuplot should be available in most Linux distributions:

apt-get install gnuplot-nox                  # Debian, Ubuntu
yum install gnuplot-minimal                  # Fedora
emerge sci-visualization/gnuplot             # Gentoo

Usage

ab

Graph data from ab:

$ cat plot.p
set terminal png
set output "ab.png"

# Nicer aspect ratio for image size
set size 1,0.7

set title "ApacheBench"
set grid y
set xlabel "requests"
set ylabel "response time (ms)"

# Plot data using column 9 with smooth sbezier lines
plot \
   "ab_alice.dat" using 9 smooth sbezier with lines title "ab_alice",   \
   "ab_bob.dat"   using 9 smooth sbezier with lines title "ab_bob"

Plot into ab.png with:

$ gnuplot plot.p