Marco's Blog

All content personal opinions or work.
en eo


2003-06-22 2 min read Cycling General marco

I finally got to implement combined graphs in Perl. In the end, it was real simple, and it was mostly fighting with GD::Graph that held me up.

The new graphs have a few implementation changes that I found really important:
1. The scale of x and y coordinates is constant, so that you can compare two graphs directly. Right now, if you do a mostly flat ride, it looks like a mountain climb no matter what. If you ride twice as far, you end up with sharp mountains. Combined, a long flat ride looks like a short mountain pass. Needed to fix that, will increase motivation… 🙂
2. Data points are not as interesting as averages as far as speed is concerned. Changed that, too – speed is now averaged, and speed points are added on top.
3. I combined several workouts to generate a single graph. The old problem of the lazy biker that stops to look at the mountains (and catch breath) and then moves on, realizing that his/her Polar stopped and requires a new workout (bitch bitch)
4. I finally got rid of the speed spikes. I know that it seems absolutely possible to you, but I do think that riding on a flat at 65 mph is a bit unrealistic. So the code now throws out those values automatically and replaces them with the average of the adjoining data points (or undefs them, whichever I implemented 🙂

TODO: Think about throwing GD::Graph out and replace with GD straight. The limitations of GD::Graph are quite appaling.