I have got x and y values in a data file to plot bezier curves. Each (x, y) pair denotes a bezier curve. Now I need to separate the segments drawing vertical lines (dotted lines preferably). The segements should be at each (x, y) so that the multiple bezier curves are separated and can be analysized. The input file is below :
0.07 0.543022222222
0.06 0.694821399177
0.08 0.734375
0.12 0.743377777778
0.11 0.795822222222
0.09 0.772946197226
0.14 0.798727048915
0.05 0.6118208
0.06 0.517422222222
The script for gnuplot is:
set term x11 persist
set title "Animation curves"
set xlabel "Time (secs.)"
set ylabel "Parameter"
plot "curve.dat" using 1:2 notitle smooth csplines
How can I achieve it? Thank you.
You could use vectors to draw those separation lines. The following script should do the job:
set key off: Makes thenotitlekeyword redundant for all plotsset style line 2 lt 0 lc 1 lw 2: Discribes how the separation lines should look like. In this case:lt 0: dashedlc 1: redlw 2line width of 2"" u 1:($2-0.1):(0):(0.2) w vectors nohead ls 2: Actually plots the separation lines:""use the previously used data fileu 1:($2-0.1):(0):(0.2): Plot the vector between the positions(x, y - 0.2)and(x, y + 0.2)of the data file.w vectors nohead: Use vectors and let them have no head.ls 2: Use the previously defined line style 2.A problem you might have, is that in your data file there are at position
0.06two values defined, which let gnuplot take the mean of those two values. This is why the separation line at positionx=0.06is longer than at other positions, as you can see in the following graph: