Blog about PostgreSQL and other things
Setting up a terminal is necessary to determine how the data format output. One useful terminal is for example jpeg or png, that can be set as follows:
set terminal png
set terminal jpeg
Then setting up the output location:
set output "/to/path/output_pix.png"
Here are some commands for the layout of the graph:
set xlabel "TPS (tx/s)"
set ylabel "Time (s)"
set title "pgbench blah"
Plotting some data (specifying multiple outputs is fine):
# lt = line type, 1 is full
# lc = line color
# pt = point typle, 0 is none
# with linespoint, join points in a single line
plot "/to/data/path/data.txt" title "Some data" lt 1 pt 0 with linespoint
To reset a picture, simply remove the output location and recreate it:
!rm "/to/path/output_pix.png"
set output "/to/path/output_pix.png"
Control range of X/Y axis:
set xrange [0:100]
set yrange [0:2200]
Unless otherwise specified, the contents of this website are (C)Copyright Michael Paquier 2010-2026 and are licensed for use under CC BY-NC-ND 4.0.