KPLOT_DATAS_ATTACH(3) Library Functions Manual KPLOT_DATAS_ATTACH(3)

NAME

kplot_datas_attachassign multi-plot data to plotting context

LIBRARY

library “libkplot”

SYNOPSIS

#include <cairo.h>
#include <kplot.h>
int
kplot_data_attach(const struct kplot *p, struct kdata **d, const enum kplottype *t, const struct kdatacfg *const *cfg, enum kplotstype st);

DESCRIPTION

The kplot_datas_attach function assigns a “multi-data” source set d to a plotting context p, reference-counting the data sources in the process. See kplot_data_attach(3) for a more general description of attaching data. Multi-data source sets consist of a baseline and one or more pair lines, for example, a curve and its error bars. The most common usage is for graphing mean (the baseline) and standard deviation above and below (pair lines) via kdata_mean_alloc(3) and kdata_stddev_alloc(3). The order in which you arrange the array parameters d, t, and cfg: the first is for the baseline, subsequent are for pair lines as defined by st. The cfg argument can be NULL (as can individual array entries); all other parameters and indexes must not be NULL. The plot types are as follows:
KPLOTS_YERRORLINE
Draw a baseline using the first element in d. The next element is used to draw error lines above (adding to the y-position) and below (subtracting) the baseline. Subsequent lines are ignored. Data sources are matched by bucket index, not x-axis value, which is ignored for all pair data sources.

RETURN VALUES

kplot_datas_attach returns 0 if allocation of internal structures fails due to memory exhaustion, or not enough data sources have been provided.

SEE ALSO

kplot(3)
January 23, 2015 OpenBSD 5.6