plot/style
LineStyle
(LineStyle)
how a line is stroked: palette color (-1 takes the next
PointStyle
(PointStyle)
how a scatter marker is drawn: stroke and fill palette
FillStyle
(FillStyle)
how an area is filled: palette color, alpha, outline color
PlotOpts
(PlotOpts)
a plot's size, title, axis labels, bounds overrides and
line-style
(line-style [color : int width : float dash : int alpha : float] :)
allocate a line-style value.
| color | palette index, or -1 for the next automatic color | |
| width | stroke width in pixels (0.0 for the default 1.5) | |
| dash | a dash constant (dash-solid, dash-dash, ...) | |
| alpha | opacity (0.0 for the default 1.0) |
A LineStyle.
(line-style 1 2.0 (dash-solid) 1.0)
point-style
(point-style [color : int fill-color : int sym : int size : float alpha : float] :)
allocate a point-style value.
| color | stroke palette index, or -1 for the next automatic color | |
| fill-color | fill palette index, or -1 to match the stroke | |
| sym | a symbol constant (sym-circle, sym-square, ...) | |
| size | marker size in pixels (0.0 for the default 6.0) | |
| alpha | opacity (0.0 for the default 1.0) |
A PointStyle.
(point-style 2 -1 (sym-square) 8.0 1.0)
fill-style
(fill-style [color : int alpha : float line-color : int line-width : float] :)
allocate a fill-style value.
| color | palette index, or -1 for the next automatic color | |
| alpha | opacity (0.0 for the default 0.5) | |
| line-color | outline palette index, or -1 to match the fill | |
| line-width | outline width in pixels |
A FillStyle.
(fill-style 3 0.4 -1 1.0)
plot-opts
(plot-opts [width : int height : int title : cstr x-label : cstr y-label : cstr x-min : float x-max : float y-min : float y-max : float legend-pos : int] :)
allocate a plot-opts value.
| width | output width in pixels (0 for the default 600) | |
| height | output height in pixels (0 for the default 450) | |
| title | title text, or a null cstr for none | |
| x-label | x axis label, or a null cstr for none | |
| y-label | y axis label, or a null cstr for none | |
| x-min | x lower bound override (NaN to fit the data) | |
| x-max | x upper bound override (NaN to fit the data) | |
| y-min | y lower bound override (NaN to fit the data) | |
| y-max | y upper bound override (NaN to fit the data) | |
| legend-pos | 0 none, 1 top right, 2 top left, 3 bottom right, 4 bottom left |
A PlotOpts.
(plot-opts 800 600 "Title" "x" "y" nan nan nan nan 1)
plot-opts-width
(plot-opts-width [opts : PlotOpts] :)
read the configured output width.
plot-opts-height
(plot-opts-height [opts : PlotOpts] :)
read the configured output height.
default-line-style
(default-line-style :)
default line style with auto color.
default-point-style
(default-point-style :)
default point style with auto color.
default-fill-style
(default-fill-style :)
default fill style with auto color.
default-plot-opts
(default-plot-opts :)
default plot options.
dash-solid
(dash-solid :)
solid stroke constant.
dash-dash
(dash-dash :)
dashed stroke constant.
dash-dot
(dash-dot :)
dotted stroke constant.
dash-dash-dot
(dash-dash-dot :)
dash-dot stroke constant.
sym-circle
(sym-circle :)
circle point symbol constant.
sym-square
(sym-square :)
square point symbol constant.
sym-triangle
(sym-triangle :)
triangle point symbol constant.
sym-cross
(sym-cross :)
cross point symbol constant.
sym-plus
(sym-plus :)
plus point symbol constant.
sym-diamond
(sym-diamond :)
diamond point symbol constant.
palette-size
(palette-size :)
number of built-in palette entries.
palette-color
(palette-color [idx : int] :)
return (r g b) for palette index idx.
color-seq
(color-seq [start-idx : int end-idx : int n : int] :)
interpolate between palette anchors and return nearest palette indices.
Internal definitions
__nan-- quiet NaN sentinel for auto bounds.__null-cstr-- typed nil cstr sentinel.__line-style-raw-- internal: allocate a LineStyle, as a bare pointer.__point-style-raw-- internal: allocate a PointStyle, as a bare pointer.__fill-style-raw-- internal: allocate a FillStyle, as a bare pointer.__plot-opts-raw-- internal: allocate a PlotOpts, as a bare pointer.