next up previous contents
Next: Key to Gnuplot exercises Up: New User Documentation Center Previous: GNUPLOT - A Plotting

Gnuplot Exercises

The following exercises will acquaint you with the features of gnuplot so that you can more easily use it for plotting data from your programs. These exercises should be accompanied by the Gnuplot Local Users' Guide. If you do not have a copy of this documentation, you may obtain it from the Center for Experimental Computation in Fisher 201.

  1. Plotting functions:
    1. Plot the sine function.
    2. Plot the cosine function on the same plot as the sine function.
    3. Create the title ``SINE AND COSINE'' for the entire plot, and replot.
    4. Change the labels for the legend to say ``sine(x) and cosine(x)'', respectively, and replot.
    5. Turn on the grid and replot.
    6. Turn off the grid and replot.
    7. Change to polar coordinates and replot.
    8. Save the plot to a file.
    9. Print the plot (Hint: can't do this within gnuplot).
  2. Plotting from data files:
    1. Copy the files file1 and file2 into your directory from /home/physics/ph480/common/plotexer. Recall that this is done with the following command:
         cp /home/physics/ph480/common/plotexer/file1 .
    2. Plot the data file file1.
    3. Change the style of the plotting to be points connected by lines, and replot.
    4. Change the style of the plotting to be lines without points, and replot.
    5. Change the Y axis to be logarithmic, and replot.
    6. Change the Y axis to be linear, and replot.
    7. Assume that column 2 in file 2 contains X values and column 5 contains Y values. Plot the data.
    8. Assume that column 3 in file 5 contains X values and column 2 contains Y values. Plot the data.
    9. Save the plot to a file.
    10. Print the plot.



Darla K. Kuras
Thu Jul 23 11:09:59 EDT 1998