Paste command puts more than two files side by side.
file1.dat | file2.dat |
1.0 0.1
2.0 0.2
3.0 0.5
4.0 0.8
|
1.0 0.6
2.0 1.0
3.0 1.2
4.0 1.3
|
% paste file1.dat file2.dat
1.0 0.1 1.0 0.6
2.0 0.2 2.0 1.0
3.0 0.5 3.0 1.2
4.0 0.8 4.0 1.3
|
To draw figure of (X,Y) pairs when X data are in 'file1.dat' and Y
data are in 'file2.dat' :
gnuplot> plot "< paste file1.dat file2.dat" using 2:4 w lp
|
You can compare two files with this command. The paste
command writes Y data of 'file1.dat' in the second column, and those of
'file2.dat' are in the fourth column, therefore difference between two
data sets are expressed by $2-$4, and the ratios are by
$2/$4 .
gnuplot> plot "< paste file1.dat file2.dat" using 1:($2/$4) w points
|
from Ken. Thanks !
|