FnuPlot


FnuPlot

FnuPlot Namespace

TypeDescription
Data

Data that is passed as an argument to the Series type. For most of the types, we use one of the Data cases; Function is used when specifying function as a string. You do not need to create Data values directly. Instead, use Series.Line, Series.Points, etc. with the appropriate input type.

FillStyle

Represents possible fill styles of a plot. A plot can be filled using a solid fill or using a specified pre-defined pattern (represented by an integer that gnuplot understands)

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]))
Output

The type can be used to specify output type for gnuplot. The type combines a value of OutputType with additional parameters such as fonts. For example, to create a PNG, you can use:

gp.Set(output = Output(Png("/temp/test.png")))
OutputType

Various output types that can be specified to gnuplot. Currently, the wrapper supports the following options:

  • OutputType.X11 for charts that are opened in a new window
  • OutputType.Png for saving charts to a PNG file.
  • OutputType.Eps for saving charts to an EPS file.
Series

Represents a series of data for the gp.Plot function The type can be constructed directly (by setting the plot parameter to the desired series type) or indirectly using static members such as 'Series.Histogram'

SeriesType

Represents the different types or styles of series. Roughly corresponds to the gnuPlot 'with lines', 'with points' etc.

Style

Represents a style of a plot (can be passed to the Plot method to set style for single plotting or to the Set method to set the style globally)

TimeFormatX

Used to specify datetime format for the x and y axes, if they contain time data. The parameter format is a gnuplot time format; for more information refer to the gnuplot documentation.

Titles

Used to specify titles for the X and Y axes. In addition to the text for the labels, you can also specify the rotation of the labels. For example:

// specify rotated titles for x axis
Titles(x=["one"; "two"], xrotate=-70)
ModuleDescription
Ranges

Module with values for elegant construction of ranges. This module is automatically opened, so you do not need to open it explicitly. This lets you specify ranges using the following notation:

// Specify the upper bound on X axis
RangeX.[ .. 10.0]

// Specify the upper bound on Y axis
RangeY.[ .. 10.0]

// Specify both X and Y axes
Range.[-10.0 .. , 2.0 .. 8.0]
Fork me on GitHub