Top | ![]() |
![]() |
![]() |
![]() |
GwyRGBA * | color | Read / Write |
gchar * | description | Read / Write |
GdkLineStyle | line-style | Read / Write |
gint | line-width | Read / Write |
GwyGraphCurveType | mode | Read / Write |
gint | point-size | Read / Write |
GwyGraphPointType | point-type | Read / Write |
GwyGraphCurveModel represents information about a graph curve necessary to fully reconstruct it.
#define gwy_graph_curve_model_duplicate(gcmodel)
Convenience macro doing gwy_serializable_duplicate()
with all the necessary
typecasting.
GwyGraphCurveModel *
gwy_graph_curve_model_new (void
);
Creates a new graph curve model.
GwyGraphCurveModel *
gwy_graph_curve_model_new_alike (GwyGraphCurveModel *gcmodel
);
Creates new graph curve model object that has the same settings as gcmodel
.
Curve data are not duplicated.
void gwy_graph_curve_model_set_data (GwyGraphCurveModel *gcmodel
,const gdouble *xdata
,const gdouble *ydata
,gint n
);
Sets curve model data from separated X and Y arrays.
If there were calibration data in the former gcmodel
, they are removed.
xdata
values ordered from smallest to largest. It is not enforced and you
can create graphs of data the do not satisfy this condition. However,
various graph functionality may be unavailable or degraded then. You also
can use gwy_graph_curve_model_enforce_order()
afterwards to ensure the
recommended data point order.void gwy_graph_curve_model_set_data_interleaved (GwyGraphCurveModel *gcmodel
,const gdouble *xydata
,gint n
);
Sets curve model data from an interleaved array.
The array should contain interleaved abscissa and ordinate values: x0, x0, x1, y1, x2, y2, etc.
If there were calibration data in the former gcmodel
, they are removed.
xdata
values ordered from smallest to largest. It is not enforced and you
can create graphs of data the do not satisfy this condition. However,
various graph functionality may be unavailable or degraded then. You also
can use gwy_graph_curve_model_enforce_order()
afterwards to ensure the
recommended data point order.gcmodel |
A graph curve model. |
|
xydata |
X data points (array of size 2* |
|
n |
Number of points, i.e. half the number of items in |
Since: 2.45
void gwy_graph_curve_model_set_data_from_dataline (GwyGraphCurveModel *gcmodel
,GwyDataLine *dline
,gint from_index
,gint to_index
);
Sets graph curve model data from a data line.
The range of import can be modified using parameters from_index
and
to_index
that are interpreted directly as data indices within the
GwyDataLine. In the case that from_index
== to_index
, the full
GwyDataLine is used.
If there were calibration data in the former gcmodel
, they are removed.
void
gwy_graph_curve_model_enforce_order (GwyGraphCurveModel *gcmodel
);
Ensures curve model data points are sorted by abscissa in ascending order.
The function sorts the data points currently present in the model. It does
not prevent functions such as gwy_graph_curve_model_set_data()
from
disrupting the order again. See its documentation for further remarks.
The "data-changed" signal is emitted if the data order actually changes.
Since: 2.45
const gdouble *
gwy_graph_curve_model_get_xdata (GwyGraphCurveModel *gcmodel
);
Gets y data points of a graph curve model.
The returned data are owned by the and cannot be modified nor freed. The returned pointer is valid only so long as the curve model exists and its data do not change.
const gdouble *
gwy_graph_curve_model_get_ydata (GwyGraphCurveModel *gcmodel
);
Gets y data points of a graph curve model.
The returned data are owned by the and cannot be modified nor freed. The returned pointer is valid only so long as the curve model exists and its data do not change.
gint
gwy_graph_curve_model_get_ndata (GwyGraphCurveModel *gcmodel
);
Gets the number of points in a graph curve model.
gboolean gwy_graph_curve_model_get_x_range (GwyGraphCurveModel *gcmodel
,gdouble *x_min
,gdouble *x_max
);
Gets the abscissa range of a graph curve.
The values are cached in the curve model therefore repeated calls to this function (with unchanged data) are cheap.
If there are no data points in the curve, x_min
and x_max
are untouched
and the function returns FALSE
.
See also gwy_graph_curve_model_get_ranges()
for a more high-level function.
gboolean gwy_graph_curve_model_get_y_range (GwyGraphCurveModel *gcmodel
,gdouble *y_min
,gdouble *y_max
);
Gets the ordinate range of a graph curve.
The values are cached in the curve model therefore repeated calls to this function (with unchanged data) are cheap.
If there are no data points in the curve, x_min
and x_max
are untouched
and the function returns FALSE
.
See also gwy_graph_curve_model_get_ranges()
for a more high-level function.
gboolean gwy_graph_curve_model_get_ranges (GwyGraphCurveModel *gcmodel
,gboolean x_logscale
,gboolean y_logscale
,gdouble *x_min
,gdouble *x_max
,gdouble *y_min
,gdouble *y_max
);
GwyCurveCalibrationData *
gwy_graph_curve_model_get_calibration_data
(GwyGraphCurveModel *gcmodel
);
Get pointer to actual calibration data for curve.
Since: 2.23
void gwy_graph_curve_model_set_calibration_data (GwyGraphCurveModel *gcmodel
,const GwyCurveCalibrationData *calibration
);
Set calibration data for curve.
The function makes a deep copy of calibration
.
Since: 2.23
“description”
property“description” gchar *
Curve description. It appears on graph key.
Flags: Read / Write
Default value: "curve"
“line-style”
property “line-style” GdkLineStyle
Curve line style. Curve mode has to include lines for the line to be visible.
Flags: Read / Write
Default value: GDK_LINE_SOLID
“line-width”
property“line-width” gint
Curve line width.
Flags: Read / Write
Allowed values: [0,100]
Default value: 1
“mode”
property“mode” GwyGraphCurveType
Curve plotting mode (line, points, ...).
Flags: Read / Write
Default value: GWY_GRAPH_CURVE_LINE
“point-size”
property“point-size” gint
Curve point symbol size.
Flags: Read / Write
Allowed values: [0,100]
Default value: 5
“point-type”
property“point-type” GwyGraphPointType
Curve point symbol type. Curve mode has toinclude points for the symbols to be visible.
Flags: Read / Write
Default value: GWY_GRAPH_POINT_SQUARE
“data-changed”
signalvoid user_function (GwyGraphCurveModel *gwygraphcurvemodel, gpointer user_data)
The ::data-changed signal is emitted whenever curve data is set with
a function like gwy_graph_curve_model_set_data()
.
gwygraphcurvemodel |
The GwyGraphCurveModel which received the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First