ch2_2.mw


Session 2.2 Plotting lists of data and using the function yxplot

Data points to be plotted :

i          xi          yi

1         0.0        0.1

2         1.4        4.2

3         3.5        6.6

4         4.5        8.2

5         6.1        7.1

6         8.0        4.1

> restart;

> lst:=[[0,0.1],[1.4,4.2],[3.5,6.6],[4.5,8.2],[6.1,7.1],[8.0,4.1]];This is a list of lists giving the data in the table.

lst := [[0, .1], [1.4, 4.2], [3.5, 6.6], [4.5, 8.2], [6.1, 7.1], [8.0, 4.1]]

> plot(lst,title=`Data points in a list`);

[Plot]

> read "/home/ceng303/maple/yxplot"; yxplot allows you to plot data like that in the table without having to remember how lists are made. Note the quotes around the file name

yxplot := proc (xn, yn, ti, x, y) local n, z, k, x2, x1; description yxplot := proc (xn, yn, ti, x, y) local n, z, k, x2, x1; description yxplot := proc (xn, yn, ti, x, y) local n, z, k, x2, x1; description yxplot := proc (xn, yn, ti, x, y) local n, z, k, x2, x1; description yxplot := proc (xn, yn, ti, x, y) local n, z, k, x2, x1; description yxplot := proc (xn, yn, ti, x, y) local n, z, k, x2, x1; description

> x:=[0.0,1.4,3.5,4.5,6.1,8.0];

x := [0., 1.4, 3.5, 4.5, 6.1, 8.0]

> y:=[0.1,4.2,6.6,8.2,7.1,4.1];

y := [.1, 4.2, 6.6, 8.2, 7.1, 4.1]

> yxplot(`time`,`distance`,`Using yxplot`,x,y);

[Plot]

>