My favorites | Sign in
Project Home
Project Information
Members
Links

The OCaml bindings are now included in PLplot

The OCaml PLplot bindings are included in the official PLplot release. Please download and install PLplot from there!

This site will be maintained for reference only. All further development will occur in the main PLplot source tree.


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:

See the PLplot documentation for more information on the OCaml bindings. Also, feel free to ask on the PLplot mailing list if you have any questions not covered by the documentation.

Powered by Google Project Hosting