Gnuplot is a simple program for displaying
and printing graphs.
To get started:
/* Output square and cube */ #include <stdio.h> main() { FILE *fp = fopen("out.dat","w") ; /* opens file "out.dat", with label fp. */ /* The "w" means we are going to write to the file */ double x ; x = -5. ; while (x<5.) { /* loop over x-coordinate as long as x<5 */ fprintf(fp,"%lf %lf %lf\n",x,x*x,x*x*x); /* output to file square and cube */ x = x + .1; /* increase x for next step in loop */ } fclose(fp) ; /* close file */ }
See also this website or this website for more gnuplot tips