FnuPlot


GnuPlot

The main type of the library. It provides a wrapper for calling gnuplot from F#. Plots are drawn using the Plot function and can be created using the Series type. For example:

// Create gnuplot process
let gp = GnuPlot()

// Plot a function specified as a string
gp.Plot("sin(x)")

// Create a simple line plot
gp.Plot(Series.Lines [2.0; 1.0; 2.0; 5.0])   

// Create a histogram plot drawn using blue color 
gp.Plot(Series.Histogram(lineColor=Color.Blue, data=[2.0; 1.0; 2.0; 5.0]))

Constructors

ConstructorDescription
new(path)
Signature: (path:string option) -> GnuPlot

Create a new instance of the GnuPlot object. This starts the gnuplot process in the background. The optional parameter path can be used to specify gnuplot location if it is not available in PATH.

Instance members

Instance memberDescription
Plot(data, style, range, output, titles)
Signature: (data:seq<Series> * style:Style option * range:Range option * output:Output option * titles:Titles option) -> unit

Draw a plot consisting of multiple data series. Range and style can be specified using optional parameters. For example:

// Create a simple line plot
gp.Plot
 [ Series.Lines(title="Lines", data=[2.0; 1.0; 2.0; 5.0])
   Series.Histogram(fill=Solid, data=[2.0; 1.0; 2.0; 5.0]) ]
Plot(data, style, range, output, titles)
Signature: (data:Series * style:Style option * range:Range option * output:Output option * titles:Titles option) -> unit

Draw a plot of a single data series. Range and style can be specified using optional parameters. For example:

// Create a simple line plot
gp.Plot(Series.Lines [2.0; 1.0; 2.0; 5.0],
        range = RangeY.[-1.0 ..])   
Plot(func, style, range, output, titles)
Signature: (func:string * style:Style option * range:Range option * output:Output option * titles:Titles option) -> unit

Draw a plot specified as a string. Range and style can be specified using optional parameters. For example:

// draw sin(x) function
gp.Plot("sin(x)")
SendCommand(str)
Signature: str:string -> unit

Send a string command directly to the gnuplot process.

Set(...)
Signature: (style:Style option * range:Range option * output:Output option * titles:Titles option * TimeFormatX:TimeFormatX option) -> unit

Set a style or a range of the gnuplot session. For example:

// set fill style to a numbered pattern
gp.Set(style = Style(fill = Pattern(3)))

// set the X range of the output plot to [-10:]
gp.Set(range = RangeX.[-10.0 .. ]
Unset(style, range)
Signature: (style:Style option * range:Range option) -> unit

Reset style or range set previously (used mainly internally)

Fork me on GitHub