gnuplot

Gnuplot is another program to visualize data. But, in contrast to grace, gnuplot does not provide you a window with menues to change viewing options.
$ gnuplot
will start an interactive gnuplot session that is somehow similar to the usage of a terminal.

You can easily plot the data in the first file by typing:

gnuplot> plot "data.1"

This will produce an x-y plot of the data in file data.1, where gnuplot adjusts the $ x$- and $ y$-axis according to the data provided. By default, the data points from the data file are plotted as little plus sings +. You can change this behavior by appending with lines to the plot command:

gnuplot> plot "data.1" with lines

Additionally, gnuplot assumes the data to be provided as one or two columns in your data file. If there is just one column in your file, gnuplot uses that data for the $ y$-axis. Otherwise, if two columns of data are provided, the first column denotes the $ x$- and the second the $ y$-coordinate. If your data file has more than two columns or your data is provided in another order, you can tell gnuplot which of them should be used for which coordinates with the statement using.

gnuplot> plot "urbanareas.tsv" using 4:5 with lines
This will produce a plot of the data in urbanareas.tsv where the $ 4$th column is used as $ x$- and the $ 5$th column as $ y$-coordinate.

In order to adjust the plot to your own needs, e.g. the range of the $ x$- or $ y$-axis, colors, logarithmic scales and so on, there exist several settings that can be set/unset using the commands set and unset

set xrange [0:1000] will set the range of the x-axis to the
                    interval [0:1000]
set yrange [-5:10]  similar to xrange
set logscale x      turns on logarithmic scaling for the x axis
set logscale y                    - "" -                 y axis
unset xrange        unsets a specified xrange, i.e. the range
                    of the x-axis will be determined by the data
unset logscale x    unsets logarithmic scaling for the x axis

Consult the implemented help function within the gnuplot interactive shell by typing

gnuplot> help
or
gnuplot> help plotting
Alternatively, you can visit the website
http://t16web.lanl.gov/Kawano/gnuplot/index-e.html
to obtain more information about how to tweak the output. Using this website, find out how to save your graph as a postscript file that you may include in any scientific work.

You can leave the interactive gnuplot session by typing

gnuplot> exit

Ronny Lorenz 2010-04-06