package prbnmcn-gnuplot

  1. Overview
  2. Docs
Declarative generation of gnuplot scripts

Install

Dune Dependency

Authors

Maintainers

Sources

0.0.2.tar.gz
md5=813665e1462ddd4bb538104e41a89d31
sha512=10a597bfbc89b1fe14f8e7005fd90a27871f58fba2bd1c2ef1c45d6bf8a5a3d7aeeaf1ea39e8409d6b7705987e0e017483a8cb61152c34cb705aad4f4578671f

Description

Declarative generation of gnuplot scripts

Published: 22 Mar 2022

README

prbnmcn-gnuplot

This library provides an relatively basic overlay over Gnuplot. It provides facilities for performing scatterplots, line plots and histograms.

Look no further for the documentation.

Note that some features exposed by the library do not work with Gnuplot versions below 5.4.

Here's a tiny example, plotting a sine function and displaying it on the Qt backend.

let discretize f =
  Array.init 100 (fun i ->
      let x = float_of_int i *. 0.1 in
      Plot.r2 x (f x))

let sin =
  let open Plot in
  Line.line_2d
    ~points:(Data.of_array (discretize sin))
    ~style:
      Style.(default |> set_color Color.red |> set_point ~ptyp:Pointtype.box)
    ~with_points:true
    ~legend:"sin"
    ()

let () =
  let target = Plot.qt () in
  Plot.(run
         ~target
         ~plot:(plot2 ~xaxis:"x" ~yaxis:"y" ~title:"sin" [sin])
         exec)

This produces something like this.

An alternative to this library is ocaml-gnuplot.

Dependencies (4)

  1. conf-gnuplot
  2. base-unix
  3. ocaml >= "4.08.0"
  4. dune >= "2.8"

Dev Dependencies (1)

  1. odoc with-doc

Used by (1)

  1. prbnmcn-dagger-test = "0.0.2"

Conflicts

None

OCaml

Innovation. Community. Security.