The folowing graph is generated with gnuplot: 
It shows 5 (but it can be more or less) waves. However, what I need is display each wave separately, like this (I did with gimp):

Is there a way to do this with gnuplot? I also need that each wave be a different colour, as I have now.
Here is gnuplot script used: http://pastebin.com/vAD2syTS
Here is the python script that gnuplot script uses to fix my data: http://pastebin.com/WEncNjDA
Here is the data: http://pastebin.com/ewBpvHWM
Here is the data after python script fixes it: http://pastebin.com/cgimMyr9
I had some fun with this one. My strategy involves plotting the first, last and intermediate plots with slightly different settings in order to get the borders to line up. I also define some functions to ensure that all the plot colors will indeed be different unless you have upwards of ~16 million data sets to plot.
The output on your sample data set looks like this:

The sizes of the top/bottom plots aren’t quite perfect, and as mgilson said it would probably take some fiddling with
set xmargin at screen ...commands to make all the plot sizes equal.(If nothing else those int->RGB converter can be handy for specialized applications; I also have functions going from RGB codes to ints.)
EDIT: I updated the script so all the plots will have the same height.