Next: Example 2: Up: Using GNUPLOT for Previous: Using GNUPLOT for

Example 1:

Here is a first example, producing a plot for this document. The GNUPLOT input file is given below, and the output appears as Figure 1. The input file defines the output to be in , gives a file name for the output, and plots for on . To produce the figure, I simply \input{eg1} in a center environment in a figure environment. In following examples, I will enclose the figure in a box to make it look a little better.


    set terminal latex
    set output "eg1.tex"
    plot [-3.14:3.14] sin(x)

Note that GNUPLOT has drawn in the axes, labeled the tic marks for us, scaled the axis automatically, and added a key in the upper-right-hand corner (this may be moved with the set key command, and removed with set nokey).

This is the default line style for the driver. Because of the limited picture capabilities of , many dots are required to approximate drawing a solid line. This may overload the memory of many implementations. There are other line types available that draw dotted lines and use much less memory. The EEPIC driver draws solid lines with much less memory usage.


distr@bl.physik.tu-muenchen.de
Do Apr 7 11:25:09 MDT 1994