Created
June 17, 2010 09:39
-
-
Save shelling/441909 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 <stdio.h> | |
| #include <math.h> | |
| #include <string.h> | |
| #include <gsl/gsl_math.h> | |
| #include <plplot/plplot.h> | |
| #include <plplot/plConfig.h> | |
| int main (int argc, char **argv) { | |
| PLFLT x[101], y[101]; | |
| for ( int i = 0; i < 100; i++ ) { | |
| x[i] = sin(i*M_PI/180.L); | |
| y[i] = i*M_PI/180.L; | |
| } | |
| plinit(); | |
| plenv(0, 10, 0, 10, 1, -1); | |
| plline(100, x, y); | |
| char *filename = "/home/shelling/public_html/hello-plplot.png"; | |
| PLINT cur_strm, new_strm; | |
| plgstrm(&cur_strm); | |
| plmkstrm(&new_strm); | |
| plsfnam(filename); | |
| plsdev("png"); | |
| plcpstrm(cur_strm, 0); | |
| plreplot(); | |
| plend1(); | |
| plend(); | |
| } |
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
| all: hello-plplot.c | |
| gcc -o hello-plplot hello-plplot.c -std=c99 -lplplotd | |
| clean: | |
| rm -rf hello-plplot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment