take a look at gnuplot, it's widely used in the scientific community to quickly plot data; your program can generate data files or even gnuplot scripts to automate complex plot generation directly...