Plotting with Gnuplot

Overview

Graphical display is an essential part of visualizing, analysing, and presenting scientific results. We present some basic techniques for turning the output of your program into 2-D and 3-D plots, images, and movies. Specifically, we discuss the gnuplot graphics package, which will allow you to produce high-quality plots with minimal effort, and save them in a form suitable for printing or inclusion in printed documents. A helpful tutorial on gnuplot may be found here; the full (long!) gnuplot manual is here.

Outline

  1. Presenting data

  2. Some basic requirements for a plotting package

  3. What data format should we use?  Exercise: making datafiles.

  4. Introduction to gnuplot

  5. An application from the Graduate workshop:  fw.c.   Save the output of this program in a file -- fw.dat, say -- then run gnuplot with the command

            plot [0:1.5] [0:1.2] "fw.dat"

    to see the convergence of the bisection procedure. Or use gnuplot's index feature to see specific iterations:

            plot [0:1.5] [0:1.2] "fw.dat" index 5:8

  6. The gpl script