title: merging multiple data files to plot in a single graph
body: <p>extending the question I had asked earlier which can be found here, <a href="https://stackoverflow.com/questions/7107552/plotting-multiple-x-y-co-ordinates-in-a-single-curve-with-gnuplot/7112405#7112405">plotting multiple (x,y) co-ordinates in a single curve with gnuplot</a>. I am trying to plot the bezier curves in gnuplot using 2 different files. Each (x,y) from the first file forms a bezier curve passing through the points from the second file. The first file has the co-ordinates like the following:</p>
  
  <pre><code> x      y  
  0.0    0.5     
  0.12   0.1    
  0.16   0.4    
  0.2    0.35   
  0.31   0.8    
  0.34   0.6   
  0.38   1.0    
  0.46   0.2   
  0.51   0.7    
  0.69   0.9    
  </code></pre>
  
  <p>The second file has the co-ordinates as the following:</p>
  
  <pre><code> x      y
  0.00   0.7
  0.04   0.74073082208
  0.08   0.85926917792 
  0.12   0.9 
  0.16   0.9
  0.2    0.9  
  0.24   0.749720623086
  0.28   0.874229601255
  0.32   0.74073082208
  0.36   0.8 
  0.4    0.721178508605 
  0.44   0.878821491395
  0.48   0.761772990545
  0.52   0.700774803388
  0.56   0.723771273415
  0.6    0.789508073675
  0.64   0.864014272269
  0.68   0.896743348931
  </code></pre>
  
  <p>Now, how do I merge these two files to plot a single graph. These two files don't have the same number of rows, but I guess that doesn't matter. The first curve would be between (x1,y1) and (x2,y2) from the first file which would continue till (x10,y10). In the curve between (x1,y1) and (x2,y2); the points (x1,y1), (x2,y2) and (x3,y3) from the second file lie. </p>
  
  <p>I followed this link <a href="http://t16web.lanl.gov/Kawano/gnuplot/datafile3-e.html" rel="nofollow noreferrer">http://t16web.lanl.gov/Kawano/gnuplot/datafile3-e.html</a> to sort and concatenate the two files but got some weird lines which is totally wrong. These values should actually plot Bezier curves but not getting the graph. I have written the following gnuplot script to plot the concatenated data:</p>
  
  <pre><code>set term x11 persist
  set title "Animation curves"
  set xlabel "Time (secs.)"
  set ylabel "Parameter"
  set x2label "Phoneme1" offset -35
  set pointsize 2
  set key off
  set style line 2 lt 0 lc 1 lw 2
  set xrange [0.0:1.0]
  set yrange [0.0:1.3]
  
  plot [0.0:0.8] "&lt; cat -n file1.dat" u 1:2 smooth csplines ls 1, "" u 1:(0.0):(0):(1.3) w vectors nohead ls 2, "" u ($1+0.005):(1):(sprintf("P %d", $0)) w labels, \
             "file1.dat" u 1:2 with points, \
             "file2.dat" u 1:2 with points, \    
  </code></pre>
  
  <p>I got the following error:</p>
  
  <pre><code>plot "&lt; cat -n file1.dat" u 1:2 smooth csplines ls 1, "" u 1:(0.0):(0):(1.3) w vectors    nohead ls 2, "" u ($1+0.005):(1):(sprintf("P %d", $0)) w labels, "file1.dat" u 1:2 with points, "file2.dat" u 1:2 with points,                  
                            ^
  "plot.gp", line 21: Cannot smooth: no data within fixed xrange!
  </code></pre>