Ocamlplot
This is OCamlplot, an interface that makes the libplot
library
accessible to the OCaml language.
This project is hosted on sourceforge :
http://sourceforge.net/projects/ocamlplot/
The libplot library
Libplot is a part of the GNU
plotutils package. It's "a powerful C/C++ function library for
exporting 2-D vector graphics in many file formats, both vector and
raster". The API is devide-independent and the library knows about
PostScript, PNG, SVG, X, etc.
Download
From the sourceforge
download page.
I made a RPM for plotutils :
plotutils-2.4.1-7.src.rpm (3.2 Mo).
Documentation
The interface sticks closely to libplot's API, so the main reference is the
libplot manual and the interface file plot.mli
. Here
is the ocamldoc-generated documentation.
- Modules
The Plot
module contains all the basic types and function
declarations corresponding to the C API of libplot. It contains mainly type
declarations and externals, and a wrapper for creating plotters.
- Names
In libplot, function names are of the form pl_function_r
. The ML
corresponding function name is function
. The pl_
prefix is dropped because it's redundant with Caml module names. The
_r
suffix is for reentrant to distinguish names from an older API
(not thread-safe). Since I did not write code for this older API, I just dropped
the suffix.
Many libplot functions expect string arguments. The corresponding arguments in
the ML code are usually variants or boolean, whichever makes sense (just check
plot.mli
).
- Limitations
All of the libplot plotters are supported (Xdrawables via LablGTK).
Licensing
GNU LGPL. The file io.h is taken from the OCaml compiler source tree (the GPL'ed
part of the tree).
Links
Some related projects :
-
MLgraph
A library to produce images in Caml. «It uses the PostScript graphical
model but in a much higher level language.»
-
ML-PostScript
A PostScript engine for OCaml.
-
CamlImages
« CamlImages is an image processing library. »
-
Graphics
The Graphics library from the OCaml distribution.
-
GraphPS
« A Caml library that generates PostScript files from Caml graphics
drawings. »
- GD4O
An OCaml interface to the GD graphics library.
Gz
This a wrapper for the zlib and bzip2 libraries. It allows transparent reading and
writing of compressed files from OCaml. (This is just a quick wrapper I
wrote to learn how to interface C libraries with OCaml).
It can be downloaded from
sourceforge or here gz-0.5.7.tar.gz
and here is some documentation.
Data Structures
- Discrete Interval Encoding Tree (diet)
- This data structure implements sets of integers in a simple and efficient
way.
Reference:
http://www.cs.orst.edu/~erwig/diet/.
Download
- Skip lists
- A skip list is a probabilistic list-based data structure that is a simple
and efficient subsitute for balanced trees. Skip lists can implement a dictionary
abstract data type. The data structure is not persistent, though.
Reference:
A Skip List Cookbook.
Download
Miscellaneous stuff
- An autoconf macros file to check for OCaml tools in configure scripts :
ocaml.m4.
AUTHOR :
Olivier Andrieu <oliv__a@users.sourceforge.net>
Project hosted on
Last change: Mon 19 Sep 2005 03:50:16 PM CEST