GpThe workflow is:
(module Plot) -> unit functiondraw below.Simple example:
open Gp
let figure (module P: Plot) =
P.plot (S "cos(x)") ~style:"l lc 8 lw 2" [ barebone ]
let () = draw ~output:(png "test.png") figureval prms : ?tmp_root:string -> ?gnuplot:string -> ?init:string -> unit -> prmsval set : string -> propertyval unset : string -> propertyval load : string -> propertyval barebone : propertyTrim the plot to the bare minimum: no axes, no labels, no tics, nothing but your lovely plot. A great place to start for a beautiful plot.
val title : ?o:string -> string -> propertyval tics : string -> propertyval xtics : ?o:string ->
[ `auto | `manual of (float * string) list | `regular of float list ] -> propertyval ytics : ?o:string ->
[ `auto | `manual of (float * string) list | `regular of float list ] -> propertyval ztics : ?o:string ->
[ `auto | `manual of (float * string) list | `regular of float list ] -> propertyval cbtics : ?o:string ->
[ `auto | `manual of (float * string) list | `regular of float list ] -> propertyval x2tics : ?o:string ->
[ `auto | `manual of (float * string) list | `regular of float list ] -> propertyval y2tics : ?o:string ->
[ `auto | `manual of (float * string) list | `regular of float list ] -> propertyval xlabel : ?o:string -> string -> propertyval ylabel : ?o:string -> string -> propertyval zlabel : ?o:string -> string -> propertyval cblabel : ?o:string -> string -> propertyval x2label : ?o:string -> string -> propertyval y2label : ?o:string -> string -> propertyval xrange : ?o:string -> (float * float) -> propertyval yrange : ?o:string -> (float * float) -> propertyval zrange : ?o:string -> (float * float) -> propertyval cbrange : ?o:string -> (float * float) -> propertyval x2range : ?o:string -> (float * float) -> propertyval y2range : ?o:string -> (float * float) -> propertyval default_props : property listSome decent default plot properties.
type data = See Plot.plot for meaning of parameters. Example:
let () =
let x = Mat.gaussian 100 4 in
let fig (module P: Plot) =
P.plots
[ item (A x) ~using:"1:3" ~style:"p pt 7 lc 8 ps 0.5";
item (A x) ~using:"2:4" ~style:"p pt 7 lc 7 ps 0.5" ]
[ barebone ] in
draw ~output:(png "test") figmodule type Plot = sig ... endContains all the commands you need to draw your figure
NB: if you are in a Jupyter notebook, you should not use any of the terminals below; instead, use Juplot.draw.
val svg : ?font:string -> ?size:(int * int) -> ?other_term_opts:string -> string -> outputval png : ?font:string -> ?size:(int * int) -> ?other_term_opts:string -> string -> outputval qt : ?id:int -> ?font:string -> ?size:(int * int) -> ?other_term_opts:string ->
?pause:string -> unit -> outputval latex : ?term_opts:string -> string -> outputval cmbright : tikz_fontval helvetica : tikz_fontMain drawing function: takes an output terminal (see Output terminals above) and a figure.
val interactive : ?interactive:bool -> ?size:(int * int) ->
((module Plot) -> unit) -> unitThis is a shorthand for draw ~output:(qt ());