Introduction to Gnuplot

You can find the full lecture on this material at You will need to use the username "modern" and the password discussed in lecture today to access the web page and to download the datafile mentioned in problem 2 below. Please contact Michael Richmond if you are unable to access these materials.

You will often need to create graphs to illustrate your measurements, and show the degree to which they match predictions of some particular model. We recommend gnuplot as a tool for making graphs. It runs on all major platforms, it's free, it can create graphics good enough to publish, and it has some powerful features. It is already installed on the computers in the Mac OS side of the Gosnell Computer Lab, and on the computers in the Modern Physics Lab rooms. You can acquire a copy from

Professor Barton has written a brief guide to installing gnuplot under Windows.

If you want to install gnuplot under Mac OS X, I recommend the clever trick involving another analysis package which will make the installation very easy, and avoid all compiling.

  1. You perform a simple physics experiment: you drop a ball from a third-story window which is 50 meters above the ground. You measure its distance from the window as a function of time for 2 seconds. Create a graph which shows both the displacement of the ball from the window, and the height of the ball above the ground, as a function of time, from t = 0 to t = 2 seconds. Give your graph reasonable labels.
  2. You can find a datafile with a small closeup of the solar spectrum in the visible (taken from the BAse de donnees Solaire Sol website) at

    Create a graph which shows a closeup of the weak absorption line in this datafile centered near 6547.7 Angstroms. Zoom in so that the data in this region cover your graph from left to right and from top to bottom.

    Use your graph to estimate the central wavelength of this line, the approximate width of the line, and its approximate depth.

  3. Generate your own datafiles which contain intensity as a function of wavelength for bodies with temperatures of 3, 10, 30, and 100 Kelvin. Create a single graph which shows the blackbody spectrum (intensity per unit wavelength as a function of wavelength) for all four bodies. Use a range of wavelengths which is wide enough to show the peak of all the spectra.
  4. Use your graph from the previous problem to measure the wavelength at which each body's spectrum has its peak. Create a new graph which shows the peak wavelength of a body as a function of the INVERSE of its temperature.