Module Gr
OCaml Bindings for the GR Framework
GR is based on an implementation of a Graphical Kernel System (GKS) and OpenGL. As a self-contained system it can quickly and easily be integrated into existing applications.
The GR framework can be used in imperative programming systems or integrated into modern object-oriented systems, in particular those based on GUI toolkits. GR is characterized by its high interoperability and can be used with modern web technologies and mobile devices. The GR framework is especially suitable for real-time environments.
The bindings aree based on version 0.37.0, but should work in any successive version.
Make sure libgr is installed. Currently the library is only looked through the default library paths of your system or using GRDIR. You can customise this further by specifying the path to libGR.so or libGR.dylib via the environment variable LIBGRPATH.
module Lowlevel : sig ... endThis module contains the bindings to the lowlevel C interface.
type linetype=Available line types, see also GR Line Types
type markertype=Available marker types, see also GR Marker Types
type scale_options=|OPTION_X_LOGLogarithmic X-axis
|OPTION_Y_LOGLogarithmic Y-axis
|OPTION_Z_LOGLogarithmic Z-axis
|OPTION_FLIP_XFlip X-axis
|OPTION_FLIP_YFlip Y-axis
|OPTION_FLIP_ZFlip Z-axis
type spline_algo=|GeneralizedCrossValidatedSmoothing|InterpolatingNaturalCubic|CubicBSplinetype font=type text_precision=|STRINGString precision (higher quality)
|CHARCharacter precision (medium quality)
|STROKEStroke precision (lower quality)
type text_path_direction=|RIGHTleft-to-right
|LEFTright-to-left
|UPdownside-up
|DOWNupside-down
type text_halign=|NORMAL|LEFTLeft justify
|CENTERCenter justify
|RIGHTRight justify
type text_valign=type pattern_stylePattern style, see also GR Fill Patterns and Hatches
val pattern_style : int -> pattern_style
type hatch_styleHatch style, see also GR Fill Patterns and Hatches
val hatch_style : int -> hatch_style
type fill_style=|HOLLOWNo filling. Just draw the bounding polyline
|SOLIDFill the interior of the polygon using the fill color index
|PATTERN of pattern_styleFill the interior of the polygon using the style index as a pattern index
|HATCH of hatch_styleFill the interior of the polygon using the style index as a cross-hatched style
type color_map=Color Maps, see also GR Color Maps
type surface_options=type segment
module Workstation : sig ... endmodule Gks : sig ... endmodule State : sig ... endval set_window : float -> float -> float -> float -> unitset_window xmin xmax ymin ymaxestablishes a window, or rectangular subspace, of world coordinates to be plotted. If you desire log scaling or mirror-imaging of axes, use the gr_setscale function.This function defines the rectangular portion of the World Coordinate space (WC) to be associated with the specified normalization transformation. The WC window and the Normalized Device Coordinates (NDC) viewport define the normalization transformation through which all output primitives are mapped. The WC window is mapped onto the rectangular NDC viewport which is, in turn, mapped onto the display surface of the open and active workstation, in device coordinates. By default, GR uses the range [0,1] x [0,1], in world coordinates, as the normalization transformation window.
Parameters
xmin: The left horizontal coordinate of the window (xmin<xmax).xmax: The right horizontal coordinate of the window (xmin<xmax).ymin: The bottom vertical coordinate of the window (ymin<ymax).ymax: The top vertical coordinate of the window (ymin<ymax).
val set_viewport : float -> float -> float -> float -> unitset_viewport xmin xmax ymin ymaxestablishes a rectangular subspace of normalized device coordinates.This function defines the rectangular portion of the Normalized Device Coordinate (NDC) space to be associated with the specified normalization transformation. The NDC viewport and World Coordinate (WC) window define the normalization transformation through which all output primitives pass. The WC window is mapped onto the rectangular NDC viewport which is, in turn, mapped onto the display surface of the open and active workstation, in device coordinates.
Parameters
xmin: The left horizontal coordinate of the viewport (0 <=xmin<xmax).xmax: The right horizontal coordinate of the viewport (xmin<xmax<= 1).ymin: The bottom vertical coordinate of the viewport (0 <=ymin<ymax).ymax: The top vertical coordinate of the viewport (ymin<ymax<= 1).
val select_transformation : int -> unitselect_transformation transformselects a predefined transformation from world coordinates to normalized device coordinates.Parameters
transform: A normalization transformation number:0selects the identity transformation in which both the window and viewport have the range of 0 to 1;>= 1selects a normalization transformation as defined byset_windowandset_viewport.
val clip : bool -> unitclip indicatorsets the clipping indicator. This function enables or disables clipping of the image drawn in the current window. Clipping is defined as the removal of those portions of the graph that lie outside of the defined viewport. If clipping is on, GR does not draw generated output primitives past the viewport boundaries. If clipping is off, primitives may exceed the viewport boundaries, and they will be drawn to the edge of the workstation window. By default, clipping is on.Parameters
indicator: An indicator specifying whether clipping is on or off.falseclipping is off. Data outside of the window will be drawn.trueclipping is on. Data outside of the window will not be drawn.
val segment : int -> segmentval create_segment : segment -> unitval set_segment_transform : segment -> float -> float -> float -> float -> float -> float -> float -> unitval close_segment : unit -> unitval set_space : float -> float -> int -> int -> intset_space zmin zmax rotation tiltsets the abstract Z-space used for mapping three-dimensional output primitives into the current world coordinate space.This function establishes the limits of an abstract Z-axis and defines the angles for rotation and for the viewing angle (tilt) of a simulated three-dimensional graph, used for mapping corresponding output primitives into the current window. These settings are used for all subsequent three-dimensional output primitives until other values are specified. Angles of rotation and viewing angle must be specified between 0 and 90 degrees.
Parameters
zmin: Minimum value for the Z-axis.zmax: Maximum value for the Z-axis.rotation: Angle for the rotation of the X axis, in degrees.tilt: Viewing angle of the Z axis, in degrees.
val set_linetype : linetype -> unitval set_linewidth : float -> unitset_linewidth lwdefines the line width of subsequent polyline output primitives.The line width is calculated as the nominal line width generated on the workstation multiplied by the line width scale factor. This value is mapped by the workstation to the nearest available line width. The default line width is 1.0, or 1 times the line width generated on the graphics device.
val set_linecolorindex : int -> unitset_linecolorindex cdefines the color of subsequent polyline output primitives. Note: c < 1256
val set_markertype : markertype -> unitval set_markersize : float -> unitset_markersize msspecify the marker size for polymarkers.The polymarker size is calculated as the nominal size generated on the graphics device multiplied by the marker size scale factor.
val set_markercolorindex : int -> unitset_markercolorindex cdefine the color of subsequent markers output primitives. Note: c < 1256
val set_arrowstyle : int -> unitval set_arrowsize : float -> unitset_arrowsize sizesets the arrow size to be used for subsequent arrow commands.This function defines the arrow size for subsequent arrow primitives. The default arrow size is 1.
Parameters
size: The arrow size to be used
val set_text_font_prec : ?precision:text_precision -> font -> unitset_text_font_prec ?precision fontspecifies the text font and precision for subsequent text output primitives.The appearance of a font depends on the text precision value specified. STRING, CHARACTER or STROKE precision allows for a greater or lesser realization of the text primitives, for efficiency. STRING is the default precision for GR and produces the highest quality output.
XXX: CHARACTER and STROKE precision seem to be broken (and to break the
axescommand with it...)!
val set_char_expand_factor : float -> unitset_char_expand_factor factorsets the current character expansion factor (width to height ratio).This function defines the width of subsequent text output primitives. The expansion factor alters the width of the generated characters, but not their height. The default text expansion factor is 1, or one times the normal width-to-height ratio of the text.
Parameters
factor: Text expansion factor applied to the nominal text width-to-height ratio
val set_text_colorindex : int -> unitset_text_colorindex colorsets the current text color index.This function defines the color of subsequent text output primitives. GR uses the default foreground color (black=1) for the default text color index.
Parameters
color: The text color index (COLOR < 1256)
val set_char_height : float -> unitset_char_height heightsets the current character height.This function defines the height of subsequent text output primitives. Text height is defined as a percentage of the default window. GR uses the default text height of 0.027 (2.7% of the height of the default window).
val set_char_up : (float * float) -> unitset_char_up (x, y)Set the current character text angle up vector. This function defines the vertical rotation of subsequent text output primitives. The text up vector is initially set to (0, 1), horizontal to the baseline.Parameters
x: X coordinate of the text up vectory: Y coordinate of the text up vector
val set_char_space : float -> unitval set_text_path : text_path_direction -> unitset_text_path directiondefines the current direction in which subsequent text will be drawn.
val set_text_align : text_halign option -> text_valign option -> unitset_text_align horizontal verticalspecifies how the characters in a text primitive will be aligned in horizontal and vertical space. The default text alignment indicates horizontal left alignment and vertical baseline alignment.
val set_fill_interior_style : fill_style -> unitset_fill_interior_style stylesets the fill area interior style to be used for fill areas.This function defines the interior style for subsequent fill area output primitives. The default interior style is HOLLOW.
val set_fill_colorindex : int -> unitset_fill_colorindex colorsets the current fill area color index.This function defines the color of subsequent fill area output primitives. GR uses the default foreground color (black=1) for the default fill area color index.
Parameters
color: The fill area color index (COLOR < 1256)
val set_color_representation : int -> (float * float * float) -> unitset_color_representation index (red, green, blue)redefines an existing color index representation by specifying an RGB color triplet.Parameters
index: Color index in the range 0 to 1256red: Red intensity in the range 0.0 to 1.0green: Green intensity in the range 0.0 to 1.0blue: Blue intensity in the range 0.0 to 1.0
val set_colormap : color_map -> unitset_colormap cmapsets the currently used colormap.A list of colormaps can be found at: GR Colormaps.
val set_scale : scale_options list -> intval set_shadow : (float * float) -> float -> unitset_shadow (offsetx, offsety) blurAllows drawing of shadows, realized by images painted underneath, and offset from, graphics objects such that the shadow mimics the effect of a light source cast on the graphics objects.Parameters
offsetx: An x-offset, which specifies how far in the horizontal direction the shadow is offset from the objectoffsety: A y-offset, which specifies how far in the vertical direction the shadow is offset from the objectblur: A blur value, which specifies whether the object has a hard or a diffuse edge
val set_transparency : float -> unitset_transparency alphasets the value of the alpha component associated with GR colors.Parameters
alpha: An alpha value (0.0 - 1.0)
val set_coord_transform : (float Ctypes_static.ptr, 'a, 'b) Stdlib.Bigarray.Genarray.t -> unitset_coord_transform transformChange the coordinate transformation according to the given matrix. Parametersmat: 2D transformation matrix (3x2)
module Graphics : sig ... endval polyline : ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> unitpolyline ?linetype ?linewidth ?coloridx x ydraws a polyline using the current line attributes, starting from the first data point and ending at the last data point.The values for
xandyare in world coordinates. The attributes that control the appearance of a polyline arelinetype,linewidthandcolor index.
val polyline3d : ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> (float, 'e, 'f) Stdlib.Bigarray.Genarray.t -> unitpolyline3d ?linetype ?linewidth ?coloridx x y zdraws a polyline using the current line attributes, starting from the first data point and ending at the last data point.The values for
x,yandzare in world coordinates. The attributes that control the appearance of a polyline arelinetype,linewidthandcolor index.
val polymarker : ?markertype:markertype -> ?markersize:float -> ?coloridx:int -> (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> unitpolymarker ?markertype ?markersize ?coloridx x ydraws marker symbols centered at the given data points.The values for
xandyare in world coordinates. The attributes that control the appearance of a polyline aremarkertype,markersizeandcolor index.
val polymarker3d : ?markertype:markertype -> ?markersize:float -> ?coloridx:int -> (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> (float, 'e, 'f) Stdlib.Bigarray.Genarray.t -> unitpolymarker3d ?markertype ?markersize ?coloridx x y zdraws marker symbols centered at the given data points.The values for
x,yandzare in world coordinates. The attributes that control the appearance of a polyline aremarkertype,markersizeandcolor index.
val text : float -> float -> string -> unittext x y contentdraws a text at positionx,yusing the current text attributes.The values for
xandyare in normalized device coordinates. The attributes that control the appearance of text are textfontandprecision,character expansion factor,character spacing,text color index,character height,character up vector,text pathandtext alignment.(* TODO: add styling options *)
val fillarea : (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> unitfillarea x yallows you to specify a polygonal shape of an area to be filled. The vectorsxandyspecify the coordinates of the polygonal shape corners.The attributes that control the appearance of fill areas are fill area
interior style, fill areastyle indexand fill areacolor index. (* TODO: add styling options *)
val cellarray : (float * float) -> (float * float) -> (int * int) -> (int * int) -> (int * int) -> (int, 'a, 'b) Stdlib.Bigarray.Genarray.t -> unitcellarray (xmin, xmax) (ymin, ymax) (dimx, dimy) (scol, srow) (ncol, nrow) colordisplays rasterlike images in a device-independent manner. The cell array function partitions a rectangle given by two corner points into DIMX X DIMY cells, each of them colored individually by the corresponding color index of the given cell array.The values for
xmin,xmax,yminandymaxare in world coordinates.Parameters
xmin: X coordinate of the lower left point of the rectangleymin: Y coordinate of the lower left point of the rectanglexmax: X coordinate of the upper right point of the rectangleymax: Y coordinate of the upper right point of the rectangledimx: X dimension of the color index arraydimy: Y dimension of the color index arrayscol: number of leading columns in the color index arraysrow: number of leading rows in the color index arrayncol: total number of columns in the color index arraynrow: total number of rows in the color index arraycolor: color index array
Note:
nonuniformcellarrayandpolycellarrayhave been introduced in newer versions of gr.
val spline : ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> int -> spline_algo -> unitspline ?linetype ?linewidth ?coloridx x y m method_tgenerates a cubic spline-fit, starting from the first data point and ending at the last data point.The values for
xandyare in world coordinates. The attributes that control the appearance of a spline-fit arelinetype,linewidthandcolor index.Parameters
x: The X coordinatesy: The Y coordinatesm: The number of points in the polygon to be drawnmethod: The smoothing method
val gridit : (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> (float, 'e, 'f) Stdlib.Bigarray.Genarray.t -> (int * int) -> (float, Stdlib.Bigarray.float64_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Genarray.t * (float, Stdlib.Bigarray.float64_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Genarray.t * (float, Stdlib.Bigarray.float64_elt, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Genarray.tgridit x y z (nx, ny)interpolates data from arbitrary points at points on a rectangular grid.Parameters
x: The X coordinates of the input pointsy: The Y coordinates of the input pointsz: The values of the pointsnx: The number of points in X direction for the output gridny: The number of points in Y direction for the output grid
Returns the tuple (x', y', z') with
x': The points in X direction for the output gridy': The points in Y direction for the output gridz': The interpolated values on thenxxnygrid points
val tex_text : (float * float) -> string -> inttex_text (x, y) textdraws a text at positionx,yusing the current text attributes. Strings can be defined to create basic mathematical expressions and Greek letters.The values for X and Y are in normalized device coordinates. The attributes that control the appearance of text are text
fontandprecision,character expansion factor,character spacing,text color index,character height,character up vector,text pathandtext alignment.Parameters
x: The X coordinate of starting position of the text stringy: The Y coordinate of starting position of the text stringtext: The text to be drawn
The character string is interpreted to be a simple mathematical formula. The following notations apply:
- Subscripts and superscripts: These are indicated by carets (‘^’) and underscores (‘_’). If the sub/superscript contains more than one character, it must be enclosed in curly braces (‘{}’).
 - Fractions are typeset with A ‘/’ B, where A stands for the numerator and B for the denominator.
 
To include a Greek letter you must specify the corresponding keyword after a backslash (‘') character. The text translator produces uppercase or lowercase Greek letters depending on the case of the keyword. For more sophisticated mathematical formulas, you should use the gr_mathtex function.
See the full documentation at GR Documentation for gr_textext.
val math_tex : (float * float) -> string -> unitmath_tex (x, y) texgenerates a character string starting at the given location. Strings can be defined to create mathematical symbols and Greek letters using LaTeX syntax.Parameters
x: The X coordinate of the starting position of the text stringy: The Y coordinate of the starting position of the text stringtex: The TeX text string to be drawn
val axes : ?scale:scale_options list -> ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> ?origin:(float * float) -> ?major:(int * int) -> ?tick_size:float -> float -> float -> unitaxes ?scale ?linetype ?linewidth ?origin:(0,0) ?major:(1,1) ?size:1 x_tick y_tickdraws X and Y coordinate axes with linearly and/or logarithmically spaced tick marks. Tick marks are positioned along each axis so that major tick marks fall on the axes origin (whether visible or not). Major tick marks are labeled with the corresponding data values. Axes are drawn according to the scale of the window.Parameters
x_tick: The interval between minor tick marks on the X axis.y_tick: The interval between minor tick marks on the Y axis.x_org: The world coordinate of the origin (point of intersection) of the X axis.y_org: The world coordinate of the origin (point of intersection) of the Y axis.major_x: Unitless integer value specifying the number of minor tick intervals between major tick marks on the X axis. Values of 0 or 1 imply no minor ticks. Negative values specify no labels will be drawn for the associated axis.major_y: Unitless integer value specifying the number of minor tick intervals between major tick marks on the Y axis. Values of 0 or 1 imply no minor ticks. Negative values specify no labels will be drawn for the associated axis.tick_size: The length of minor tick marks specified in a normalized device coordinate unit. Major tick marks are twice as long as minor tick marks. A negative value reverses the tick marks on the axes from inward facing to outward facing (or vice versa)
val axes_labels : ?scale:scale_options list -> ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> ?origin:(float * float) -> ?major:(int * int) -> ?tick_size:float -> (float -> float -> string -> float -> unit) -> (float -> float -> string -> float -> unit) -> float -> float -> unitaxes_labels ?(scale = []) ?linetype ?linewidth ?coloridx ?(origin = 0.0, 0.0) ?(major = 1, 1) ?(tick_size = -0.01) (fpx : float -> float -> string -> float -> unit) (fpy : float -> float -> string -> float -> unit) x_tick y_tickcreates axes in the current workspace and supply a custom function for changing the behaviour of the tick labels.Similar to
axesbut allows more fine-grained control over tick labels and text positioning by supplying callback functions. Within the callback function you can use normal GR text primitives for performing any manipulations on the label text.See
axesfor more details on drawing axes.Parameters
x_tick: The interval between minor tick marks on the X axis.y_tick: The interval between minor tick marks on the Y axis.x_org: The world coordinate of the origin (point of intersection) of the X axis.y_org: The world coordinate of the origin (point of intersection) of the Y axis.major_x: Unitless integer value specifying the number of minor tick intervals between major tick marks on the X axis. Values of 0 or 1 imply no minor ticks. Negative values specify no labels will be drawn for the associated axis.major_y: Unitless integer value specifying the number of minor tick intervals between major tick marks on the Y axis. Values of 0 or 1 imply no minor ticks. Negative values specify no labels will be drawn for the associated axis.tick_size: The length of minor tick marks specified in a normalized device coordinate unit. Major tick marks are twice as long as minor tick marks. A negative value reverses the tick marks on the axes from inward facing to outward facing (or vice versa).fpx: Function pointer to a function that returns a label for a given tick on the X axis. The callback function should have the following arguments:x: NDC of the label in X direction.y: NDC of the label in Y direction.svalue: Internal string representation of the text drawn by GR at (x,y).value: Floating point representation of the label drawn at (x,y).fpy: Exactly same as the fpx above, but for the the Y axis.
val axes3d : ?scale:scale_options list -> ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> ?origin:(float * float * float) -> ?major:(int * int * int) -> ?tick_size:float -> float -> float -> float -> unitaxes3d ?scale ?linetype ?linewidth ?origin:(0,0,0) ?major:(1,1,1) ?size:1 x_tick y_tick z_tickdraws X, Y and Z coordinate axes with linearly and/or logarithmically spaced tick marks. Tick marks are positioned along each axis so that major tick marks fall on the axes origin (whether visible or not). Major tick marks are labeled with the corresponding data values. Axes are drawn according to the scale of the window.Parameters
x_tick: The interval between minor tick marks on the X axis.y_tick: The interval between minor tick marks on the Y axis.z_tick: The length in world coordinates of the interval between minor grid lines in Z direction.x_org: The world coordinate of the origin (point of intersection) of the X axis.y_org: The world coordinate of the origin (point of intersection) of the Y axis.z_org: The world coordinate of the origin (point of intersection) of the Z axis.major_x: Unitless integer value specifying the number of minor tick intervals between major tick marks on the X axis. Values of 0 or 1 imply no minor ticks. Negative values specify no labels will be drawn for the associated axis.major_y: Unitless integer value specifying the number of minor tick intervals between major tick marks on the Y axis. Values of 0 or 1 imply no minor ticks. Negative values specify no labels will be drawn for the associated axis.major_z: Unitless integer value specifying the number of minor grid lines between major grid lines on the Z axis. Values of 0 or 1 imply no grid lines.tick_size: The length of minor tick marks specified in a normalized device coordinate unit. Major tick marks are twice as long as minor tick marks. A negative value reverses the tick marks on the axes from inward facing to outward facing (or vice versa)
val surface : ?options:surface_options -> (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> (float, 'e, 'f) Stdlib.Bigarray.Genarray.t -> unitsurface x y z ?optiondraws a three-dimensional surface plot for the given data points.Here,
xandydefine a grid,zis a singly dimensioned array containing at least nx * ny data points.zdescribes the surface height at each point on the grid.Parameters
x: X coordinatesy: Y coordinatesz: Z coordinatesoption: Surface display option
val contour : ?major_h:int -> (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> (float, 'e, 'f) Stdlib.Bigarray.Genarray.t -> (float, 'g, 'h) Stdlib.Bigarray.Genarray.t -> unitcontour ?major_h x y h zsraw contours of a three-dimensional data set whose values are specified over a rectangular mesh. Contour lines may optionally be labeled.Parameters
x: X coordinatesy: Y coordinatesh: height valuespz: Z coordinatesmajor_h: Directs GR to label contour lines. For example, a value of 3 would label every third line. A value of 1 will label every line. A value of 0 produces no labels. To produce colored contour lines, add an offset of 1000 tomajor_h.
val contourf : ?major_h:int -> (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> (float, 'e, 'f) Stdlib.Bigarray.Genarray.t -> (float, 'g, 'h) Stdlib.Bigarray.Genarray.t -> unitcontourf ?(major_h = 0) x y h zdraws filled contour plot of a three-dimensional data set whose values are specified over a rectangular mesh.Parameters
x: X coordinatesy: Y coordinatesh: height values. If NULL, use nh evenly distributed height values between minimum and maximum Z value.major_h: Directs GR to label contour lines. For example, a value of 3 would label every third line. A value of 1 will label every line. A value of 0 produces no labels. To produce colored contour lines, add an offset of 1000 tomajor_h
val grid : ?scale:scale_options list -> ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> ?origin:(float * float) -> ?major:(int * int) -> float -> float -> unitgrid ?scale ?linetype ?linewidth ?origin:(0,0) ?major:(1,1) x_tick y_tickdraws a linear and/or logarithmic grid.Major grid lines correspond to the axes origin and major tick marks whether visible or not. Minor grid lines are drawn at points equal to minor tick marks. Major grid lines are drawn using black lines and minor grid lines are drawn using gray lines.
Parameters
x_tick: The length in world coordinates of the interval between minor grid lines in X direction.y_tick: The length in world coordinates of the interval between minor grid lines in Y direction.x_org: The world coordinate of the origin (point of intersection) of the X axis.y_org: The world coordinate of the origin (point of intersection) of the Y axis.major_x: Unitless integer value specifying the number of minor grid lines between major grid lines on the X axis. Values of 0 or 1 imply no grid lines.major_y: Unitless integer value specifying the number of minor grid lines between major grid lines on the Y axis. Values of 0 or 1 imply no grid lines.
val grid3d : ?scale:scale_options list -> ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> ?origin:(float * float * float) -> ?major:(int * int * int) -> float -> float -> float -> unitgrid3d ?scale ?linetype ?linewidth ?origin:(0,0,0) ?major:(1,1,1) x_tick y_tick z_tickdraws a linear and/or logarithmic grid.Major grid lines correspond to the axes origin and major tick marks whether visible or not. Minor grid lines are drawn at points equal to minor tick marks. Major grid lines are drawn using black lines and minor grid lines are drawn using gray lines.
Parameters
x_tick: The length in world coordinates of the interval between minor grid lines in X direction.y_tick: The length in world coordinates of the interval between minor grid lines in Y direction.z_tick: The length in world coordinates of the interval between minor grid lines in Z direction.x_org: The world coordinate of the origin (point of intersection) of the X axis.y_org: The world coordinate of the origin (point of intersection) of the Y axis.z_org: The world coordinate of the origin (point of intersection) of the Z axis.major_x: Unitless integer value specifying the number of minor grid lines between major grid lines on the X axis. Values of 0 or 1 imply no grid lines.major_y: Unitless integer value specifying the number of minor grid lines between major grid lines on the Y axis. Values of 0 or 1 imply no grid lines.major_z: Unitless integer value specifying the number of minor grid lines between major grid lines on the Z axis. Values of 0 or 1 imply no grid lines.
val vertical_errorbars : (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> (float, 'e, 'f) Stdlib.Bigarray.Genarray.t -> (float, 'g, 'h) Stdlib.Bigarray.Genarray.t -> unitvertical_errorbars x y el eudraws a standard vertical error bar graph.Parameters
px: X coordinatespy: Y coordinatesel: absolute values of the lower error bar dataeu: absolute values of the upper error bar data
val horizontal_errorbars : (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> (float, 'e, 'f) Stdlib.Bigarray.Genarray.t -> (float, 'g, 'h) Stdlib.Bigarray.Genarray.t -> unithorizontal_errorbars x y el eudraws a standard horizontal error bar graph.Parameters
px: X coordinatespy: Y coordinatesel: absolute values of the lower error bar dataeu: absolute values of the upper error bar data
val titles3d : string -> string -> string -> unittitles3d x_title y_title z_titledisplays axis titles just outside of their respective axes.Parameters
x_title: The text to be displayed on the X axisy_title: The text to be displayed on the Y axisz_title: The text to be displayed on the Z axis
val tricontour : (float, 'a, 'b) Stdlib.Bigarray.Genarray.t -> (float, 'c, 'd) Stdlib.Bigarray.Genarray.t -> (float, 'e, 'f) Stdlib.Bigarray.Genarray.t -> (float, 'g, 'h) Stdlib.Bigarray.Genarray.t -> unittricontour x y z levelsdraws a contour plot for the given triangle mesh.Parameters
x: X coordinatesy: Y coordinatesz: Z coordinateslevels: contour levels
module Print : sig ... endval drawrect : ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> float -> float -> float -> float -> unitdrawrect ?linetype ?linewidth ?coloridx left right bottom updraws a rectangle.Parameters
left: Left edge of the rectangleright: Right edge of the rectanglebottom: Bottom edge of the rectangleup: Upper edge of the rectangle
val fillrect : ?fillstyle:fill_style -> ?fillcoloridx:int -> ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> float -> float -> float -> float -> unitfillrect ?fillstyle ?fillcoloridx ?linetype ?linewidth ?coloridx left right bottom updraws a filled rectangle.Parameters
left: Left edge of the rectangleright: Right edge of the rectanglebottom: Bottom edge of the rectangleup: Upper edge of the rectangle
val drawarc : ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> float -> float -> float -> float -> int -> int -> unitdrawarc ?linetype ?linewidth ?coloridx left right bottom up a1 a2draws a circular or elliptical arc covering the specified rectangle.The resulting arc begins at a1 and ends at a2 degrees. Angles are interpreted such that 0 degrees is at the 3 o’clock position. The center of the arc is the center of the given rectangle.
Parameters
left: Left edge of the rectangleright: Right edge of the rectanglebottom: Bottom edge of the rectangleup: Upper edge of the rectanglea1: The start anglea2: The end angle
val fillarc : ?fillstyle:fill_style -> ?fillcoloridx:int -> ?linetype:linetype -> ?linewidth:float -> ?coloridx:int -> float -> float -> float -> float -> int -> int -> unitfillarc ?fillstyle ?fillcoloridx ?linetype ?linewidth ?coloridx left right bottom updraws a filled circular or elliptical arc covering the specified rectangle.The resulting arc begins at a1 and ends at a2 degrees. Angles are interpreted such that 0 degrees is at the 3 o’clock position. The center of the arc is the center of the given rectangle.
Parameters
left: Left edge of the rectangleright: Right edge of the rectanglebottom: Bottom edge of the rectangleup: Upper edge of the rectanglea1: The start anglea2: The end angle
val drawpath : (float * float) array -> [< `CLOSEPOLY | `CURVE3 | `CURVE4 | `LINETO | `MOVETO | `STOP ] array -> bool -> unitdrawpath vertices codes filldraws simple and compound outlines consisting of line segments and bezier curves.The following path codes are recognized:
- `STOP end the entire path
 - `MOVETO move to the given vertex
 - `LINETO draw a line from the current position to the given vertex
 - `CURVE3 draw a quadratic Bezier curve
 - `CURVE4 draw a cubic Bezier curve
 - `CLOSEPOLY draw a line segment to the start point of the current path
 
Parameters
vertices: the vertices (x,y)codes: path codesfill: A flag indication whether resulting path is to be filled or not
val drawarrow : ?arrowsize:float -> ?arrowstyle:int -> (float * float) -> (float * float) -> unitdrawarrow ?arrowsize ?arrowstyle (x1, y1) (x2, y2)draws an arrow between two points.Different arrow styles (angles between arrow tail and wing, optionally filled heads, double headed arrows) are available. Check the documentation of
set_arrowstyleandset_arrowsizefor more information.Parameters
x1: The X coordinate of the arrow start point (tail)y1: The Y coordinate of the arrow start point (tail)x2: The X coordinate of the arrow end point (head)y2: The Y coordinate of the arrow end point (head)
val drawimage : (float * float) -> (float * float) -> (int, 'a, 'b) Stdlib.Bigarray.Genarray.t -> [< `HSV | `RGB ] -> unitdrawimage (xmin, ymin) (xmax, ymax) image_data modeldraws an image into a given rectangular area.The points (xmin, ymin) and (xmax, ymax) are world coordinates defining diagonally opposite corner points of a rectangle. This rectangle is divided into width by height cells. The two-dimensional array data specifies colors for each cell.
Parameters
xmin: X coordinate of the lower left point of the rectangleymin: Y coordinate of the lower left point of the rectanglexmax: X coordinate of the upper right point of the rectangleymax: Y coordinate of the upper right point of the rectanglewidth: X dimension of the color index arrayheight: Y dimension of the color index arraydata: color arraymodel: color model
The available color models are:
- RGB 0 AABBGGRR
 - HSV 1 AAVVSSHH
 
module Selection : sig ... end