|
|
These are bindings to the PLplot library for the OCaml language.
Example session:
open Plplot;; (* Open the PLplot namespace *)
plsdev "xwin";; (* Use the X Windows driver *)
plinit ();; (* Initialize PLplot. This will open the plotting window. *)
plenv 0.0 1.0 0.0 1.0 1 0;;
(* Set the plot dimensions and aspect ratio, draw axes *)
pllab "x label" "y label" "Title";; (* Draw labels for axes and a title *)
let x = Array.init 100 (fun _ -> Random.float 1.0);;
let y = Array.init 100 (fun _ -> Random.float 1.0);;
(* Random (x,y) values to plot *)
plpoin x y 2;; (* Plot the random points using "+" symbols *)
plend ();; (* End the PLplot session and close the plotting window *)
(* This may require a right-click in the plotting window to complete *)This will produce the following plot:
Requirements:
- OCaml (only tested with 3.10)
- PLplot (5.7.x or 5.8.x or 5.9.x)
- camlidl
- GNU make
See the included README file for build instructions and contact information. Other OCaml specific information can be found by clicking on the Wiki tab above. If there is a function or set of functions you need which is not wrapped yet, please post using the Issue tab to request its implementation.
A few examples are available in the Subversion repository.
For other OCaml PLplot bindings using SWIG rather than camlidl, see here.
