|
From: Elias A. <eli...@gm...> - 2013-10-10 08:38:57
|
I have a file that looks like this: bandindex: 1 -0.21165 -0.36658 0.28144 0.00000 -24.30536 -0.22193 -0.36065 0.28144 0.01188 -24.30546 -0.23222 -0.35471 0.28144 0.02375 -24.30536 … -0.21508 -0.35043 -0.12440 2.31382 -24.28355 -0.21336 -0.35851 -0.13256 2.32543 -24.28356 -0.21165 -0.36658 -0.14072 2.33703 -24.28353 bandindex: 2 -0.21165 -0.36658 0.28144 0.00000 -24.30536 -0.22193 -0.36065 0.28144 0.01188 -24.30546 -0.23222 -0.35471 0.28144 0.02375 -24.30536 … Columns 4 and 5 hold the data I want to plot. Column 4 increases monotonically, then jumps back to 0 and starts increasing again. These “logical blocks” are delimited by the “bandindex“ lines. If I plot this as “p 'file' u 4:5 w p”, everything works fine. But what I would like to do is plot it with lines; then I get diagonal lines through my plot whenever column 4 jumps. How can I avoid these lines in a comfortable way? Of course I can do “p "<perl -pe 's/band.*//' file" u 4:5 w l”, then the “logical blocks” become “gnuplot blocks” suppressing the diagonal lines. But I do this a lot interactively so that would be a pain to type. It is also not practical for me to change the format of the file. One way that I could imagine this to work is if I could tell gnuplot that lines "*band*" should delimit blocks (or lines containing non-numeric data, say). Another way would be if I could define an “input filter” to be applied to all data files. Is anything like that possible in gnuplot? Elias |