Plotting using grace

  1. Start the "gnumeric" spreadsheet program (you can also use Openoffice Calc as well) and enter your Galileo experiment data in two columns, height and time. Since we expect that y=(1/2)gt2, if we plot y versus t2, there should be a linear relationship with slope of g/2. This means that you will need to have a column for t2. In any spreadsheet program, you can make a column for this by defining an equation which uses your values for t to calculate t2. If you don't know how to do this, ask.
  2. In order to make the plot, you will first need to export each tab to a plain text file. This is done by the "File --> Save As" menus where you select Text (configurable) output. Set a file name and select the tab you wish to export into the file. if you want to make your life easier for later steps, write the file out with a ".dat" extension and ignore the error message that gnumeric pops up.
  3. Open grace (it is in the menu, just look around for it or type "xmgrace" in a terminal window). The grace interface is a bit clunky and outdated but it powerful program which gives you full control of the figure (plot) that you are making. This is particularly important for publication quality figures. It also writes natively to the encapsulated postscript format which is fully scalable and works very well with LyX.
  4. Read in the data sets one by one using the "Data --> Import --> ASCII" menu selection.
    1. If you wrote out your files as with the ".dat" extension, you should see them once you move to the right directory (folder). If you let gnumeric write out files with the *.txt extension you can make grace see them by replacing the ".dat" in the top box with ".txt" and press the "Filter" button down at the bottom.
    2. Select the file you wish to read in and choose "Block Data" under the "Load As" selection box. When you press the "OK" button, you will get another dialog. In this dialog, you are able to select the way you wish to read in the data. Select column 3 for "X from column:" and column 1 for "Y from column:" then press "Accept".
  5. The data that you have read in is stored internally in grace as "sets". I suggest that you immediately go to the "Edit --> Data sets" menu and select each set in turn and put in a comment which identifies the data. This will help you later if you forget or if you have many data sets in a single plot. After you have entered a comment don't forget to press the "Apply" button to confirm the change.
  6. By default, you will see the data set plotted as connected line segments. This can all be changed by going to the "Plot --> Set appearance" menu entry. This dialog will allow you to remoe the lines, put symbols at each point and cahnge colors and lots of other things. Experiment with this until you get a plot that you like.
  7. The assignment is to extract a slope (the value of g) from your group's data. This can be done with the "Data --> Transformations --> Regression" menu. You can select the set(s) that you wish to generate a linear regression for and then a new data set with the regression line will be generated. You might want to put the regression parameters in the comment for this set so you can recover the information later.
  8. You will want to put labels on the axes and parhaps customize the axes themselves. This can be done in the "Plot --> Axes appearance" menu entry. Note that you can also make superscripts and subscripts in any text that you write. You can find out the codes to do this by choosing "Help --> User Guide" and go to the section on Typesetting. You can put special characters in using the "Window --> Font Tool" (look at the Symbol font). Finally, you can add annotation, arrows and other objects with the "Window --> Drawing Objects" menu item.
  9. Make sure you save your project so you can come back and make changes later. This is done through the "File --> Save" menu. You will have to enter the file name in the lower box after you have selected the directory where you plan to keep your work. Make sure you put the extension ".agr" at the end of the name. This is the extension that grace expects even though it won't attach it automatically.
  10. In order to make your plot usable in a document, you will have to write out the graphics in a format suitable for other programs to import. You can do this through the "File --> Print Setup" menu. Select "EPS" as the "Device:" and then press "Apply". You can then actually write out the graphics file using the "File --> Print" menu entry in this dialog or on the main window. Note that other formats are supported too. The JPEG and PNG formats are bitmapped and you may have to use them for certain programs (like Openoffice or Word).
  11. Once you have written out your graphics file, write a 1 page discussion in LyX describing your results explaining why the value for g may or may have not worked out correctly. Discuss how the experiment could have been performed better to remove systematic error. Why do you think Galileo did his experiment using a different method? Would it have been better to take averages of data from the same heights before plotting? If you like, you can make a second plot using averages and standard deviations for error bars (ask me for how to do this), you might even want to prune your data by throwing out the high and low data for each height.

Note, I prefer to see figures with "Helvetica" fonts rather than the default value of "Times". This is a matter of taste.

As mentioned before, grace has a quirky interface but you can get great plots for profssional looking data on the level of Origin and it is all for free! It is worth knowing how to use it.