I'm having trouble understanding how push/popMatrix and transforms work together. In the below sketch, i'm generating a pseudo random number every half second and drawing a line the height of that number in the bottom right corner. I'd like it to "transform" the line 5 pixels to the left before drawing the next line, then move those lines 5px to the left before drawing the next, etc. This way the right most line is always the current number and the history of the lines trails off to the left.
I thought I could accomplish this by pushing the matrix, transforming everything -5,0, poping the matrix, and then drawing the new line, but it doesnt seem to be working properly, it just draws the line over the old one.
I considered storing the values in an array and drawing them anew with an offset each time, but that seems like unnecessary work, and I don;t care to save the past values, I just want to see a history of the lines which still fit on the screen.
I would appreciate any assistance to _not_ include a copy/paste solution. Trying to learn by doing, ya know? ;)