All Projects → LaurentMazare → ocaml-matplotlib

LaurentMazare / ocaml-matplotlib

Licence: MIT license
Plotting for ocaml based on matplotlib.pyplot

Programming Languages

ocaml
1615 projects
Makefile
30231 projects

ocaml-matplotlib

Plotting for ocaml using matplotlib pyplot and object-orient apis.

Use in Jupyter notebooks

To use in an ocaml jupyter notebook, you can add the following in you jupyter init script, or in a notebook cell.

open Matplotlib;;
let plot () =
  let data = Mpl.plot_data `png in
  ignore (Jupyter_notebook.display ~base64:true "image/png" data);;

let () =
    Mpl.set_backend Agg;
    Mpl.style_use "ggplot"
;;

Using plot in the notebook then flushes the current picture and displays it (no need for a temporary file, everything is in memory).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].