Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _XOPEN_SOURCE
- #include <stdio.h>
- int main(void)
- {
- FILE *plot = popen("gnuplot", "w");
- fprintf(plot, "plot '-' using 1:2 with lines\n");
- for (int x = -8; x <= 8; x++)
- fprintf(plot, "%d %d\n", x, x * x);
- fprintf(plot, "e\n");
- fflush(plot);
- getchar(); // wait
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment