Histogram demo

Image obtained by using pbm driver and then converted to png.

 1 #pragma _ipath "./"
 2 #include "plcdemos.h"
 3 
 4 #define NPTS 2047
 5 
 6 
 7 int
 8 main(int argc, char *argv[])
 9 {
10     int i;
11     PLFLT data[NPTS], delta;
12 
13 
14     (void) plParseOpts(&argc, argv, PL_PARSE_FULL);
15 
16 
17     plinit();
18 
19 
20     delta = 2.0 * PI / (double) NPTS;
21     for (i = 0; i < NPTS; i++)
22 	data[i] = sin(i * delta);
23 
24     plcol0(1);
25     plhist(NPTS, data, -1.1, 1.1, 44, 0);
26     plcol0(2);
27     pllab("#frValue", "#frFrequency",
28 	  "#frPLplot Example 5 - Probability function of Oscillator");
29 
30     plend();
31     exit(0);
32 }

Copyright 2006 Roman Putanowicz

Email: putanowr at twins.pk.edu.pl

Last Modified: Thu, 13 Jul 2006 15:36:27 CEST

Made with PubTal 3.1.3