initial commit
This commit is contained in:
BIN
DocProjet/Gnuplot/Gnuplot Cheat Sheet.pdf
Executable file
BIN
DocProjet/Gnuplot/Gnuplot Cheat Sheet.pdf
Executable file
Binary file not shown.
28
DocProjet/Gnuplot/exemple.cpp
Executable file
28
DocProjet/Gnuplot/exemple.cpp
Executable file
@@ -0,0 +1,28 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#define NUM_POINTS 100
|
||||
#define NUM_COMMANDS 2
|
||||
|
||||
int main()
|
||||
{
|
||||
char* commandsForGnuplot[] = {"set title \"EXEMPLE\"", "plot 'data.temp'"};
|
||||
double xvals[NUM_POINTS];
|
||||
double yvals[NUM_POINTS];
|
||||
FILE * temp = fopen("data.temp", "w");
|
||||
FILE * gnuplotPipe = popen ("gnuplot -persistent", "w");
|
||||
int i;
|
||||
|
||||
for (i=0; i < NUM_POINTS; i++)
|
||||
{
|
||||
xvals[i]= i*3,1415/50;
|
||||
yvals[i]= cos(xvals[i]);
|
||||
fprintf(temp, "%lf %lf \n", xvals[i], yvals[i]);
|
||||
}
|
||||
|
||||
for (i=0; i < NUM_COMMANDS; i++)
|
||||
{
|
||||
fprintf(gnuplotPipe, "%s \n", commandsForGnuplot[i]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
BIN
DocProjet/Gnuplot/gnuplot.pdf
Executable file
BIN
DocProjet/Gnuplot/gnuplot.pdf
Executable file
Binary file not shown.
Reference in New Issue
Block a user