John Heidemann / Software / Gnuplotfront

Download gnuplotfront.

Gnuplotfront is a front-end to gnuplot to make its user-interface more command-line and shell-script friendly.

Gnuplotfront is a front-end to gnuplot to make its user-interface more command-line and shell-script friendly.

Gnuplot assumes that data comes through stdin (or from a data command); outputs postscript to stdout.

Options are any valid gnuplot command, proceeded by a dash. Note that your shell will require quoting of multi-word arguments.

There are two changes, first, the “plot” command is replaced with “data”. Second, any modifiers to plot must come before the data command (in gnuplot they would normally come after the plot command).

Second, if there is no data command, then we read data from stdin.

Examples

The command

gnuplotfront \
    -set logscale xy \
    -set xlabel 'file size (bytes)' -set ylabel 'bandwidth (bits/sec)' \
    -set title 'bandwidth vs. file size' < axe_measure.dat >axe_measure.ps

is the equivalent of

set terminal postscript
set output "axe_measure.ps"
set logscale xy
set xlabel "File Size (bytes)"
set ylabel "Bandwidth (bits/sec)"
set title "Bandwidth Vs File Size"
plot "arpa/bwFile.dat"

and

gnuplotfront \
    -set nokey \
    -set xrange '[1e2:1e8]' -set yrange '[0:10e6]' \
    -set logscale x \
    -set xlabel 'File Size (bytes)' -set ylabel 'Bandwidth (bits/sec)' \
    -set title 'Bandwidth vs. File Size (axe and vgb)' \
    -using 1:2:3 -with errorbars -data vgbBUAS.dat \
    -using 1:2:4:5 -with errorbars -data vgbBUAS.dat \
    -using 1:2 -with lines -data vgbBUAS.dat >vgbBUAS.ps

is equivalent to

    #!/local/bin/gnuplot
    set terminal postscript
    set output "./vgbBUAS.ps"
    set nokey
    set xrange [100:100000000]
    set yrange [20000:8000000]
    set logscale x
    set xlabel "File Size (bytes)"
    set ylabel "Bandwidth (bits/sec)"
    set title "Bandwidth Vs File Size (Axe and Vgb)"
    plot "./vgbBUAS.dat" using 1:2:3 with errorbars 1
    plot "./vgbBUAS.dat" using 1:2:4:5 with errorbars 2
    plot "./vgbBUAS.dat" using 1:2 with lines 3

Motivation

Gnuplotfront is as verbose as gnuplot scripts. Why use it? Because it works much better in shell scripts than stock gnuplot. In stock gnuplot, if your data comes from stdin you must create (and later remove) a temporary file. If you want to parameterize the arguments of a series of plots, you have to create a temporary plot script. All of this is a pain.

Bugs

I have not exhaustively tested gnuplotfront with all gnuplot commands. Gnuplotfront needs to understand the quoting used by each command, so it may blow it for commands I failed to test.

Comments and New Versions

Comments about gnuplotfront are welcome; send mail to johnh@isi.edu. The latest version will be available on the web from <http://www.isi.edu/~johnh/SOFTWARE/gnuplotfront.html>.

Copyright © 1995-2016 by John Heidemann