~uhh-ssd/+junk/humidity_readout

« back to all changes in this revision

Viewing changes to plplot/plplot-5.9.9/examples/ocaml/x05.ml

  • Committer: Joachim Erfle
  • Date: 2013-07-24 13:53:41 UTC
  • Revision ID: joachim.erfle@desy.de-20130724135341-1qojpp701zsn009p
initial commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(* $Id: x05.ml 10463 2009-09-23 20:56:58Z hezekiahcarty $
 
2
 
 
3
        Histogram demo.
 
4
*)
 
5
 
 
6
open Plplot
 
7
 
 
8
let pi = atan 1.0 *. 4.0
 
9
 
 
10
let npts = 2047
 
11
 
 
12
(*--------------------------------------------------------------------------*\
 
13
 * Draws a histogram from sample data.
 
14
\*--------------------------------------------------------------------------*)
 
15
 
 
16
let () =
 
17
  (* Parse and process command line arguments *)
 
18
  plparseopts Sys.argv [PL_PARSE_FULL];
 
19
 
 
20
  (* Initialize plplot *)
 
21
  plinit ();
 
22
 
 
23
  (* Fill up data points *)
 
24
 
 
25
  let delta = 2.0 *. pi /. float_of_int npts in
 
26
  let data = Array.init npts (fun i -> sin (float_of_int i *. delta)) in
 
27
 
 
28
  plcol0 1;
 
29
  plhist data (-1.1) 1.1 44 [PL_HIST_DEFAULT];
 
30
  plcol0 2;
 
31
  pllab "#frValue" "#frFrequency"
 
32
    "#frPLplot Example 5 - Probability function of Oscillator";
 
33
 
 
34
  plend ();
 
35
  ()
 
36