package prbnmcn-gnuplot

  1. Overview
  2. Docs
Declarative generation of gnuplot scripts

Install

Dune Dependency

Authors

Maintainers

Sources

0.0.4.tar.gz
md5=6ab6dbee143c172a717491f53fa9ed31
sha512=79ec19d9c25253832a91027942e85284b040331e09cad16cc0af58f5a8977a1d4c68432aa8b97d6cce5fa2bb5beff4e57dcd6352d90a430f9f112f99e7dd67c5

Description

Declarative generation of gnuplot scripts

Published: 21 Jul 2023

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
         exec
         (plot2 ~xaxis:"x" ~yaxis:"y" ~title:"sin" [sin]))

This produces something like this.

An alternative to this library is ocaml-gnuplot.

Dependencies (3)

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

Dev Dependencies (2)

  1. odoc with-doc
  2. conf-gnuplot with-test

Used by (1)

  1. prbnmcn-dagger-test = "0.0.3"

Conflicts

None

OCaml

Innovation. Community. Security.