What's new? | Help | Directory | Sign in
Google
ocaml-plplot
PLplot library bindings for OCaml
  
  
  
  
    
Join project
Project owners:
  hcarty

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:

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 Git repository.

For other OCaml PLplot bindings using SWIG rather than camlidl, see here.