package gnuplot

  1. Overview
  2. Docs
Simple interface to Gnuplot Gnuplot-OCaml provides a simple interface to Gnuplot from OCaml. The API supports only 2D graphs and was inspired by FnuPlot

Install

Dune Dependency

Authors

Maintainers

Sources

v0.6.tar.gz
md5=8fe3760b78c5f9d06c295a693aaed95e
sha512=41d1c20afaa039e6f7b9fccabd2de6ed2d78b6f820878ab34822f69b5a771fb57da4ebab0da13c7ec0e48f2fdbdae5f75c9953d142fc52740462c8321a22f767

Description

Published: 28 Dec 2019

README

Gnuplot-OCaml - Simple interface to Gnuplot

Ocaml-Gnuplot provides a simple interface to Gnuplot from OCaml. The API supports only 2D graphs and was inspired by FnuPlot.

This is a fork of https://bitbucket.org/ogu/gnuplot-ocaml/ . Changes mainly include API changes that are friendlier with module Gp = Gnuplot (as opposed to open Gnuplot), moving to dune for the build, and removing Core as a dependency.

Installation

From OPAM

$ opam install gnuplot

From Source

$ make
$ make install

NOTE: For a persistent X11 terminal add set term x11 persist to your .gnuplot file in your home directory.

Usage

Documentation

The API-documentation of this distribution can be built with make doc. It can also be found online.

Examples

This simple example

module Gp = Gnuplot

let () =
  let gp = Gp.create () in
  Gp.plot_many gp ~range:(Gp.Range.XY (-10., 10., -1.5, 1.5))
   [ Gp.Series.lines_func  "sin(x)" ~title:"Plot a line" ~color:`Blue
   ; Gp.Series.points_func "cos(x)" ~title:"Plot points" ~color:`Green ];
  Gp.close gp

generates the following plot:

For more examples please refer to the examples-directory of this distribution. You can build the examples with dune, e.g.

$ dune build examples/gbm_paths.exe

Running

$ dune exec examples/gbm_paths.exe

displays 10 simulated paths of geometric Brownian motion:

Dependencies (5)

  1. ocaml >= "4.03"
  2. dune >= "1.0"
  3. conf-gnuplot
  4. ISO8601 >= "0.2"
  5. base-unix

Dev Dependencies (1)

  1. odoc with-doc

Conflicts

None

OCaml

Innovation. Community. Security.