Library
Module
Module type
Parameter
Class
Class type
A 2D plotting library with various backends.
module A = Archimedes
let vp = A.init ["graphic"; "hold"] in
A.Axes.box vp;
A.fx vp sin 0. 10.;
A.close vp
module Matrix : sig ... end
Module implementing affine transformations and various operations on them.
module Color : sig ... end
Abstract representation of colors (suitable for RGBA).
module Path : sig ... end
Creating abstract paths.
module Backend : sig ... end
Module providing a uniform interface and managing the dynamic loading of the backends. This modules is only useful to create new backends and should not be used for plotting data.
module Coordinate : sig ... end
Systems of coordinates (inhomogeneous homotheties) relative to other coordinate systems with automatic updates. The automatic update refers to the fact that, if a coordinate system is upated, all coordinate systems which depend on it (possibly through several intermediate coordinate systems), they will use the updated version.
module Viewport : sig ... end
Area on which graphs can be made.
module Sampler : sig ... end
Adaptative sampling of functions.
module Marker : sig ... end
Module handling point styles and marks.
module Arrows : sig ... end
Arrow styles
module Tics : sig ... end
Tics position and labels.
module Axes : sig ... end
Routines to draw basic axes systems in a 2-dimensional space. One can either draw axes separately using add_(x|y)_axis or use a full default axes system with box or cross.
val init :
?lines:float ->
?text:float ->
?marks:float ->
?bg:Color.t ->
?w:float ->
?h:float ->
?dirs:string list ->
string list ->
Viewport.t
init backend
initializes Archimedes and returns the main viewport using the backend specified. The first element of backend
is the name (case insensitive) of the underlying engine. It may be followed by one or several options.
"hold"
will display the graphics window until you press a key. ["BMP"; filename]
will save a copy of the display as a Windows Bitmap image file named filename
."Cairo"; "PNG"; filename
uses a PNG surface to be saved to filename
. You can replace "PNG" with "PDF", "PS" and "SVG".The empty list selects "Graphics"; "hold"
.
Selects a backend according to the filename suffix. If the suffix is not matched (this in particular for ""
), the graphics backend is selected.
val show : Viewport.t -> unit
Alias for Viewport.show
.
val close : Viewport.t -> unit
val set_color : Viewport.t -> Color.t -> unit
Alias for Viewport.set_color
.
val set_line_width : Viewport.t -> float -> unit
Alias for Viewport.set_line_width
.
val xrange : Viewport.t -> float -> float -> unit
Alias for Viewport.xrange
.
val yrange : Viewport.t -> float -> float -> unit
Alias for Viewport.yrange
.
Style of various plots. Plotting functions only support the subset of these style that make sense for them.
`Lines
Data points are joined by a simple line.`Markers
Data points are marked with the mark type given in argument of the Points constructor.`Linesmarkers
Data points are joined by a line and marked with the mark type given in argument.`Impulses
Data points are "hit" by lines starting from zero.`Bars w
Data points determine the height of a box of width w
which must be given in Data
coordinates (from 0 to 1).`HBars h
Data points determine the width of an horizontal box of height h
which must be given in Data
coordinates (from 0 to 1).For the list of default marks for `Markers
and `Linesmarkers
have a look to Marker.names
. You can also define your own with Marker.add
.
val fx :
Viewport.t ->
?tlog:bool ->
?fn0:float ->
?n:int ->
?strategy:Sampler.strategy ->
?cost:Sampler.cost ->
?style:[ `Lines | `Linesmarkers of string | `Markers of string ] ->
?base:(float -> float) ->
?fill:bool ->
?fillcolor:Color.t ->
(float -> float) ->
float ->
float ->
unit
Plotting functions.
fx vp f a b
draws the graph of the function f
on the interval [a, b]
.
val xyf :
Viewport.t ->
?tlog:bool ->
?fn0:float ->
?n:int ->
?strategy:Sampler.strategy ->
?cost:Sampler.cost ->
?style:[ `Lines | `Linesmarkers of string | `Markers of string ] ->
?fill:bool ->
?fillcolor:Color.t ->
(float -> float * float) ->
float ->
float ->
unit
xyf vp f a b
draws the image of the function f
on the interval [a, b]
, that is the set of points (x,y) = f
(t) for t in [a,b]
.
The optional arguments are the same as for fx
.
module Array : sig ... end
Plotting float Arrays.
module List : sig ... end
Plotting Lists of floats.
module Vec : sig ... end
Plotting Fortran bigarrays.
module CVec : sig ... end
Plotting C bigarrays.
val y :
Viewport.t ->
?base:((float -> unit) -> unit) ->
?fill:bool ->
?fillcolor:Color.t ->
?style:style ->
((float -> unit) -> unit) ->
unit
y vp iter
draws on vp
the values provided by the iterator iter
. See Array.y
for more information.
val xy :
Viewport.t ->
?fill:bool ->
?fillcolor:Color.t ->
?style:[ `Lines | `Markers of string | `Linesmarkers of string ] ->
((float -> float -> unit) -> unit) ->
unit
xy vp iter
plots on vp
the values provided by the iterator iter
. See Array.xy
for more information.
module Piechart : sig ... end