4.1 Reading data into plotdata

When you have quit plotdata it ``forgot'' what vectors x, y, dy were, and if you want to look at them again for some reason, you need to re-type them. A more convenient approach would have been to enter your data into a file using your favourite editor first, and then to read that file into plotdata at will. In fact, you may already have created this file from the previous tutorial session, when you practiced using vi or pico. Otherwise, create this file (call it file.dat) now, using your favourite editor outside of plotdata. You may want to open a separate shell window for this purpose, putting your plotdata session aside for a moment. Enter the following data into this data file:

1.0  0.05  0.02
2.0  0.10  0.07
3.0  0.14  0.01
4.0  0.19  0.04
5.0  0.25  0.05
6.0  0.30  0.10
7.0  0.34  0.02
8.0  0.40  0.04
i.e. the same data as we used before, now entered as three columns.

Start plotdata again, or move your mouse to the plotdata window, and use a single read command to create all three vectors of our simple example:

PLOTDATA: read file.dat x,y,dy
PLOTDATA: list x,y,dy

Use the list command to verify that the data has been read in correctly. The rest of the commands required to generate the plot of Figure 1 remains exactly the same. Test yourself: try to generate this plot again.


Up: 4. A simple example Next: 4.2 Programming with plotdata macros Previous: 4. A simple example