Skip to content

Instantly share code, notes, and snippets.

@shelling
Created June 17, 2010 09:39
Show Gist options
  • Select an option

  • Save shelling/441909 to your computer and use it in GitHub Desktop.

Select an option

Save shelling/441909 to your computer and use it in GitHub Desktop.
#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();
}
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