Problems programming a graph to eliminate random freak plots

I have an Arduino Duemilanove Board to which I attached a current sensor in order to read values of the current flowing through various domestic loads. The circuit also consists of a resistor across which I am reading the voltage via the analog pins of the board. Each value that is read is then plotted using Processing 1.5.
My problem is that while the graph is being plotted, I randomly get strange diagonal lines (resulting from plots of both the axes - colour black - and the graph itself - colour purple).

Can anyone help me understand why this is happening please? I've been over the entire code time and time again and the command for plotting is strictly restricted to the reading from the Arduino board and the plotting of the axes is a simple loop to plot a horizontal/vertical line, I haven't tried to complicate things.

Any help is much appreciated! Thanks!

Can anyone help me understand why this is happening please?

Without seeing any code? Unlikely.

Could be lots of reasons. The primary reason that comes to mind is ignoring the possibility of lost serial data, treating the serial data as if everything was sent. But, without seeing the code, it's just a guess.

can i post the code over here? or would it be too much text for a post? (sorry I'm new here :blush:)

can i post the code over here?

Makes it easier to read than posting it on the wall in the men's room.

would it be too much text for a post?

I'm not up for guessing games this morning. You know how much code it is. I don't.

Try posting it, make sure you use the code tags - the # button in the toolbar. If it's too big, the forum software will complain, then you can use additional options to put it in as a file attachment