package archimedes

  1. Overview
  2. Docs

Plotting float Arrays.

val y : Viewport.t -> ?const_base:bool -> ?base:float array -> ?fill:bool -> ?fillcolor:Color.t -> ?style:style -> ?const_y:bool -> float array -> unit

y vp yvec draws the set of points (i, yvec.(i)).

  • parameter style

    the style used for the plot. The default style is `Marker "O" which means data points are marked by a small disk. See Archimedes.style for a full list.

  • parameter fill

    whether to fill the surface between the base and the values yval.

  • parameter const_y

    whether the input vector yvec will not be modified anymore (so there is no need to cache its current values).

  • parameter base

    for the styles `Lines, `Markers, and `Linesmarkers, it gives the bottom of the filling zone. For the styles `Impulses and `Bars w, it is the Y value above which the boxes (of heights given by yvec) are drawn. For the style `HBars, it is the (signed) distance to the Y axis at which the horizontal bar starts.

  • parameter const_base

    same as const_y for the base.

val xy : Viewport.t -> ?fill:bool -> ?fillcolor:Color.t -> ?style:style -> ?const_x:bool -> float array -> ?const_y:bool -> float array -> unit

xy cp xvec yvec draws the set of points (xvec.(i), yvec.(i)). The optional arguments are similar to Array.y.

  • raises Invalid_argument

    if xvec and yvec do not have the same length.

    See Array.y for the meaning of optional arguments.

val xy_pairs : Viewport.t -> ?fill:bool -> ?fillcolor:Color.t -> ?style:[ `Lines | `Markers of string | `Linesmarkers of string ] -> (float * float) array -> unit

See Array.xy. The only difference is that this function takes an array of couples (x,y) instead of two arrays, one for x and a second of y.

val stack : Viewport.t -> ?fill:bool -> ?fillcolors:Color.t array -> ?style:style -> ?const:bool -> float array array -> unit

stack yvecs plot the data in a stacked fashion, the Y values contained in yvecs.(i) are represented as the deviation above yvecs.(i-1). This makes sense only if the data is non-negative.

  • parameter style

    how to represent each data point. Default `Bars 0.5.

  • parameter colors

    the colors for the data lines.

  • parameter fill

    whether to fill the boxes or area under the data points. Default: true.

  • parameter fillcolors

    the ith color is used to fill the area under the data points yvecs.(i). If the array is empty, a default palette is used. If there are less colors than vectors in yvecs, they are used in a circular way.

  • parameter const_y

    whether the input vector yvec will not be modified anymore (so there is no need to cache its current values).

OCaml

Innovation. Community. Security.