Created
November 5, 2016 16:22
-
-
Save Hajto/1eba896b328cd438f97679cc9f42e269 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#define NUM_POINTS 5 | |
#define NUM_COMMANDS 2 | |
int main() | |
{ | |
//To ci potrzebne se przepisz | |
char * commandsForGnuplot[] = {"set title \"TITLEEEEE\"", "plot 'data.temp'"}; | |
double xvals[NUM_POINTS] = {1.2, 2.0, 3.0, 4.0, 4.5}; | |
double yvals[NUM_POINTS] = {4.8 ,3.0, 1.0, 3.0, 3.23}; | |
//Otwarcie polecenia | |
FILE * gnuplotPipe = popen ("gnuplot -persistent", "w"); | |
fprintf(gnuplotPipe, "plot '-' \n"); | |
int i; | |
for (int i = 0; i < NUM_POINTS; i++) | |
{ | |
//Wrzucasz wartosci do rysowania | |
fprintf(gnuplotPipe, "%lf %lf\n", xvals[i], yvals[i]); | |
} | |
//wyrysowanie | |
fprintf(gnuplotPipe, "e"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment