(* $Id: plot.mli,v 1.1 2009/10/20 23:05:03 garrigue Exp $ *) (* Plot: a library to plot graphs of functions easily *) (* Adjust coordinates in the window so that it contains all points in the list. Can also be used as: adjust_size [minx, miny; maxx, maxy]. After adjusting, opens a window and draw axis. *) val adjust_size : (float * float) list -> unit (* Create the graph of a function between minx and maxx. Passing this graph to adjust_size will ajust the window to display it. *) val create_curve : (float -> float) -> (float * float) list (* Draw the graph as a curve *) val draw_curve : (float * float) list -> unit (* A standard use of these functions is: open Plot ;; adjust_size [-5., 0.; 5., 0.] ;; let curve = create_curve (fun x -> (sin x) ** 2. -. 0.5) ;; adjust_size curve ;; draw_curve curve ;; *)