Gnuplot is a really good idea. In case you want another, a really nice option in the pngwriter libraries. It can be installed from synaptic (libpng12-0) and (libpng12-dev).
You can find full details on the package at
http://pngwriter.sourceforge.net/
which details how to do everything you could want.
For an simple example program take the following.
Code:
#include "pngwriter.h"
#include <iostream>
int main()
{
int i;
pngwriter png(400,300,0.999,"test.png");
/*Make a 400,300 white window called test*/
for(i = 1; i < 900;i++)
{
png.plot(i,150+100*sin((double)i*45/900.0), 1.0, 0.0, 0.0);
/*The above plots a red sin graph*/
}
png.close();
system("eog test.png");/*If you want to show the file*/
system("rm test.png");/*If you want the remove the file after*/
return 0;
}
Once you installed pngwriter, compile the above, remembering to link to the pngwriter library (check the link above if stuck how to do this) and bob's your uncle.
Bookmarks