package archimedes

  1. Overview
  2. Docs

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.

type offset =
  1. | Relative of float
    (*

    A relative offset is given in the Data coordinate system. So you can ensure that the axis is drawn at the other axis' origin (offset: Relative 0.)

    *)
  2. | Absolute of float
    (*

    An absolute offset is given in the Graph coordinate system and should have a value between 0 and 1. Using this kind of offset, one can ensure to always get the same rendering

    *)

The axis can be padded using an offset. It is used to control where to place the axis (according to the other axis)

val x : ?grid:bool -> ?major:(string * float) -> ?minor:(string * float) -> ?start:Arrows.style -> ?stop:Arrows.style -> ?tics:Tics.t -> ?offset:offset -> Viewport.t -> unit

x vp adds an x-axis to the viewport vp.

  • parameter major

    is a couple (mark, size) drawn at each major tic position.

  • parameter start

    the arrow ending style on the left (x0) (see the Arrows module)

  • parameter stop

    the arrow ending style on the right (xend) (see the Arrows module)

  • parameter tics

    the "tics policy" for this axis (see the Tics module)

  • parameter offset

    where to place the axis (y-coordinate)

val y : ?grid:bool -> ?major:(string * float) -> ?minor:(string * float) -> ?start:Arrows.style -> ?stop:Arrows.style -> ?tics:Tics.t -> ?offset:offset -> Viewport.t -> unit

y vp adds an y-axis to the viewport vp.

  • parameter start

    the arrow ending style on the bottom (y0) (see the Arrows module)

  • parameter stop

    the arrow ending style on the top (yend) (see the Arrows module)

  • parameter tics

    the "tics policy" for this axis (see the Tics module)

  • parameter offset

    where to place the axis (x-coordinate)

val box : ?grid:bool -> ?tics:Tics.t -> ?tics_alt:Tics.t -> Viewport.t -> unit

box vp A default system of axes consisting of four axes, one on each border of the viewport vp, resulting in a box surrounding the viewport.

  • parameter tics

    the "tics policy" for the left and bottom axes (see the Tics module for more information over tics policies)

  • parameter tics_alt

    the "tics policy" for the right and top axes (see the Tics module for more information over tics policies)

val cross : ?tics:Tics.t -> Viewport.t -> unit

cross vp A default axes system consisting of two axes, centered on the origin ((0, 0) in Data coordinates).

  • parameter tics

    the "tics policy" of the axes (see the Tics module for more information over tics policies)