That's interesting as a programming exercise, but HP's plotters all had a built-in language called HP-GL. And there's a GPL'ed tool that will emit HP-GL. I just can't recall what it's called. Seems like it was built in to some normal printing tool. HP Laserjet printers also supported HP-GL, so that was a nice way to get your plots without having to buy a more expensive dedicated plotter.