![]() |
![]() |
![]() |
Gwyddion Widgets Library Reference Manual | ![]() |
---|---|---|---|---|
GwyGraphModel; GwyGraphModelClass; #define gwy_graph_model_duplicate (gmodel) GwyGraphModel* gwy_graph_model_new (void); GwyGraphModel* gwy_graph_model_new_alike (GwyGraphModel *gmodel); gint gwy_graph_model_get_n_curves (GwyGraphModel *gmodel); gint gwy_graph_model_add_curve (GwyGraphModel *gmodel, GwyGraphCurveModel *curve); gint gwy_graph_model_remove_curve_by_description (GwyGraphModel *gmodel, const gchar *description); void gwy_graph_model_remove_curve (GwyGraphModel *gmodel, gint cindex); GwyGraphCurveModel* gwy_graph_model_get_curve_by_description (GwyGraphModel *gmodel, const gchar *description); GwyGraphCurveModel* gwy_graph_model_get_curve (GwyGraphModel *gmodel, gint cindex); gint gwy_graph_model_get_curve_index (GwyGraphModel *gmodel, GwyGraphCurveModel *curve); void gwy_graph_model_remove_all_curves (GwyGraphModel *gmodel); void gwy_graph_model_set_title (GwyGraphModel *model, const gchar *title); void gwy_graph_model_set_label_position (GwyGraphModel *model, GwyGraphLabelPosition position); void gwy_graph_model_set_label_has_frame (GwyGraphModel *model, gboolean label_has_frame); void gwy_graph_model_set_label_frame_thickness (GwyGraphModel *model, gint thickness); void gwy_graph_model_set_label_reverse (GwyGraphModel *model, gboolean reverse); void gwy_graph_model_set_label_visible (GwyGraphModel *model, gboolean visible); void gwy_graph_model_set_si_unit_x (GwyGraphModel *model, GwySIUnit *siunit); void gwy_graph_model_set_si_unit_y (GwyGraphModel *model, GwySIUnit *siunit); void gwy_graph_model_set_units_from_data_line (GwyGraphModel *model, GwyDataLine *data_line); const gchar* gwy_graph_model_get_title (GwyGraphModel *model); GwyGraphLabelPosition gwy_graph_model_get_label_position (GwyGraphModel *model); gboolean gwy_graph_model_get_label_has_frame (GwyGraphModel *model); gint gwy_graph_model_get_label_frame_thickness (GwyGraphModel *model); gboolean gwy_graph_model_get_label_reverse (GwyGraphModel *model); gboolean gwy_graph_model_get_label_visible (GwyGraphModel *model); GwySIUnit* gwy_graph_model_get_si_unit_x (GwyGraphModel *model); GwySIUnit* gwy_graph_model_get_si_unit_y (GwyGraphModel *model); GString* gwy_graph_model_export_ascii (GwyGraphModel *model, gboolean export_units, gboolean export_labels, gboolean export_metadata, GwyGraphModelExportStyle export_style, GString *string); const gchar* gwy_graph_model_get_axis_label (GwyGraphModel *model, GtkPositionType pos); void gwy_graph_model_set_axis_label (GwyGraphModel *model, GtkPositionType pos, const gchar *label); void gwy_graph_model_set_direction_logarithmic (GwyGraphModel *model, GtkOrientation direction, gboolean is_logarithmic); gboolean gwy_graph_model_get_direction_logarithmic (GwyGraphModel *model, GtkOrientation direction); gboolean gwy_graph_model_x_data_can_be_logarithmed (GwyGraphModel *model); gboolean gwy_graph_model_y_data_can_be_logarithmed (GwyGraphModel *model); gdouble gwy_graph_model_get_xmin (GwyGraphModel *model); gdouble gwy_graph_model_get_xmax (GwyGraphModel *model); gdouble gwy_graph_model_get_ymin (GwyGraphModel *model); gdouble gwy_graph_model_get_ymax (GwyGraphModel *model); void gwy_graph_model_set_xmin (GwyGraphModel *model, gdouble value); void gwy_graph_model_set_xmax (GwyGraphModel *model, gdouble value); void gwy_graph_model_set_ymin (GwyGraphModel *model, gdouble value); void gwy_graph_model_set_ymax (GwyGraphModel *model, gdouble value);
"axis-label-bottom" gchararray : Read / Write "axis-label-left" gchararray : Read / Write "axis-label-right" gchararray : Read / Write "axis-label-top" gchararray : Read / Write "n-curves" gint : Read "title" gchararray : Read / Write
"layout-updated" void user_function (GwyGraphModel *gwygraphmodel, gpointer user_data) : Run first
typedef struct { GObjectClass parent_class; void (*layout_updated)(GwyGraphModel *gmodel); gpointer reserved2; gpointer reserved3; gpointer reserved4; gpointer reserved5; } GwyGraphModelClass;
#define gwy_graph_model_duplicate(gmodel)
Convenience macro doing gwy_serializable_duplicate()
with all the necessary
typecasting.
gmodel : |
A graph model to duplicate. |
GwyGraphModel* gwy_graph_model_new (void);
Creates a new graph model.
Returns : | New graph model as a GObject. |
GwyGraphModel* gwy_graph_model_new_alike (GwyGraphModel *gmodel);
Creates new graph model object that has the same settings as gmodel
.
This includes axis/label visibility, actual plotting range, etc.
Curves are not duplicated or referenced.
gmodel : |
A graph model. |
Returns : | New graph model. |
gint gwy_graph_model_get_n_curves (GwyGraphModel *gmodel);
gmodel : |
A graph model. |
Returns : | number of curves in graph model. |
gint gwy_graph_model_add_curve (GwyGraphModel *gmodel, GwyGraphCurveModel *curve);
Adds a new curve to a graph model.
gmodel : |
A graph model. |
curve : |
A GwyGraphCurveModel representing the curve to add. |
Returns : | The index of the added curve in gmodel .
|
gint gwy_graph_model_remove_curve_by_description (GwyGraphModel *gmodel, const gchar *description);
Removes all the curves having same description string as description
.
gmodel : |
A graph model. |
description : |
Curve description (label). |
Returns : | The number of removed curves. |
void gwy_graph_model_remove_curve (GwyGraphModel *gmodel, gint cindex);
Removes the curve having given index.
gmodel : |
A graph model. |
cindex : |
Curve index in graph model. |
GwyGraphCurveModel* gwy_graph_model_get_curve_by_description (GwyGraphModel *gmodel, const gchar *description);
gmodel : |
A graph model. |
description : |
Curve description (label). |
Returns : | The first curve that has description (label) given by description
(no reference is added).
|
GwyGraphCurveModel* gwy_graph_model_get_curve (GwyGraphModel *gmodel, gint cindex);
Gets a graph model curve by its index.
gmodel : |
A graph model. |
cindex : |
Curve index in graph model. |
Returns : | The curve with index cindex (no reference is added).
|
gint gwy_graph_model_get_curve_index (GwyGraphModel *gmodel, GwyGraphCurveModel *curve);
Finds the index of a graph model curve.
gmodel : |
A graph mode. |
curve : |
A curve model present in gmodel to find.
|
Returns : | The index of curve in gmodel , -1 if it is not present there.
|
void gwy_graph_model_remove_all_curves (GwyGraphModel *gmodel);
Removes all the curves from graph model
gmodel : |
A graph model. |
void gwy_graph_model_set_title (GwyGraphModel *model, const gchar *title);
Sets the title of a graph model.
model : |
A graph model. |
title : |
A new graphmodel title. |
void gwy_graph_model_set_label_position (GwyGraphModel *model, GwyGraphLabelPosition position);
Sets the label (curve desriptions) postion on graph widget.
model : |
A graph model. |
position : |
A new graphmodel label position. |
void gwy_graph_model_set_label_has_frame (GwyGraphModel *model, gboolean label_has_frame);
Sets whether graph label widget should have a frame around it. Note that the
label must be visible (see #gwy_graph_model_set_label_visible()
)
to see label.
model : |
A graph model. |
label_has_frame : |
label frame mode. |
void gwy_graph_model_set_label_frame_thickness (GwyGraphModel *model, gint thickness);
Sets the label frame thickness. Note that both the frame and label must
be visible (see #gwy_graph_model_set_label_visible()
) to see label and label
frame.
model : |
A graph model. |
thickness : |
Label frame thickness (in pixels). |
void gwy_graph_model_set_label_reverse (GwyGraphModel *model, gboolean reverse);
Sets the label alignment (curve samples and their description postion).
By setting the reverse
= TRUE you get alignment ("text", "sample"),
otherwise you get alignment ("sample", "text").
model : |
A graph model. |
reverse : |
Label alingment mode. |
void gwy_graph_model_set_label_visible (GwyGraphModel *model, gboolean visible);
Sets the graph widget label visibility.
model : |
A graph model. |
visible : |
Label visibility. |
void gwy_graph_model_set_si_unit_x (GwyGraphModel *model, GwySIUnit *siunit);
Sets the physical unit for graph x axis. The unit is duplicated, so you are
responsible for freeing siunit
.
model : |
A graph model. |
siunit : |
physical unit for x axis |
void gwy_graph_model_set_si_unit_y (GwyGraphModel *model, GwySIUnit *siunit);
Sets the physical unit for graph y axis. The unit is duplicated, so you are
responsible for freeing siunit
.
model : |
A graph model. |
siunit : |
physical unit for y axis |
void gwy_graph_model_set_units_from_data_line (GwyGraphModel *model, GwyDataLine *data_line);
Sets x and y graph model units to match a data line.
model : |
A graph model. |
data_line : |
A data line to take units from. |
const gchar* gwy_graph_model_get_title (GwyGraphModel *model);
model : |
A graph model. |
Returns : | graph title. |
GwyGraphLabelPosition gwy_graph_model_get_label_position (GwyGraphModel *model);
model : |
A graph model. |
Returns : | graph widget label position. |
gboolean gwy_graph_model_get_label_has_frame (GwyGraphModel *model);
model : |
A graph model. |
Returns : | graph widget label frame visibility. |
gint gwy_graph_model_get_label_frame_thickness (GwyGraphModel *model);
model : |
A graph model. |
Returns : | graph widget label frame thickness. |
gboolean gwy_graph_model_get_label_reverse (GwyGraphModel *model);
model : |
A graph model. |
Returns : | graph widget label alignment mode. |
gboolean gwy_graph_model_get_label_visible (GwyGraphModel *model);
model : |
A graph model. |
Returns : | graph widget label visibility. |
GwySIUnit* gwy_graph_model_get_si_unit_x (GwyGraphModel *model);
model : |
A graph model. |
Returns : | A GwySIUnit containing the physical unit of the x-axis of model .
(Do not free).
|
GwySIUnit* gwy_graph_model_get_si_unit_y (GwyGraphModel *model);
model : |
A graph model. |
Returns : | A GwySIUnit containing the physical unit of the y-axis of model .
(Do not free).
|
GString* gwy_graph_model_export_ascii (GwyGraphModel *model, gboolean export_units, gboolean export_labels, gboolean export_metadata, GwyGraphModelExportStyle export_style, GString *string);
Exports a graph model data to a file.
The export format is specified by parameter export_style
.
model : |
A graph model. |
export_units : |
export units in the column header |
export_labels : |
export labels in the column header |
export_metadata : |
export all graph metadata within file header |
export_style : |
specifies the file format to export to (e. g. plain, csv, gnuplot, etc.) |
string : |
|
Returns : |
const gchar* gwy_graph_model_get_axis_label (GwyGraphModel *model, GtkPositionType pos);
Gets the label of a one graph model axis.
model : |
A graph model. |
pos : |
Axis position. |
Returns : | The label as a string owned by the model. |
void gwy_graph_model_set_axis_label (GwyGraphModel *model, GtkPositionType pos, const gchar *label);
Sets one axis label of a graph model.
model : |
A graph model. |
pos : |
Axis position. |
label : |
The new label. |
void gwy_graph_model_set_direction_logarithmic (GwyGraphModel *model, GtkOrientation direction, gboolean is_logarithmic);
Sets data along the axis specified by direction
to display either
logarithmically (is_logarithmic
=TRUE) or normally (is_logarithmic
=FALSE).
model : |
A graph model. |
direction : |
axis orientation (e. g. horizontal, vertical). |
is_logarithmic : |
the logarithmic mode |
gboolean gwy_graph_model_get_direction_logarithmic (GwyGraphModel *model, GtkOrientation direction);
model : |
A graph model. |
direction : |
axis orientation (e. g. horizontal, vertical). |
Returns : | TRUE if the axis specified by direction is currently set to display
logarithmically. FALSE if it is set to display normally.
|
gboolean gwy_graph_model_x_data_can_be_logarithmed (GwyGraphModel *model);
model : |
A graph model. |
Returns : | TRUE if all x-values are greater than zero (thus logarithmic display of x-data is safe). |
gboolean gwy_graph_model_y_data_can_be_logarithmed (GwyGraphModel *model);
model : |
A graph model. |
Returns : | TRUE if all y-values are greater than zero (thus logarithmic display of y-data is safe). |
gdouble gwy_graph_model_get_xmin (GwyGraphModel *model);
Returns bounding value for all the curves within model. This value is recomputed while adding curves to the graph depending on actual graph settings.
model : |
A graph model. |
Returns : | x minimum bounding value of the curves |
gdouble gwy_graph_model_get_xmax (GwyGraphModel *model);
Returns bounding value for all the curves within model. This value is recomputed while adding curves to the graph depending on actual graph settings.
model : |
A graph model. |
Returns : | x maximum bounding value of the curves |
gdouble gwy_graph_model_get_ymin (GwyGraphModel *model);
Returns bounding value for all the curves within model. This value is recomputed while adding curves to the graph depending on actual graph settings.
model : |
A graph model. |
Returns : | y minimum bounding value of the curves |
gdouble gwy_graph_model_get_ymax (GwyGraphModel *model);
Returns bounding value for all the curves within model. This value is recomputed while adding curves to the graph depending on actual graph settings.
model : |
A graph model. |
Returns : | y maximum bounding value of the curves |
void gwy_graph_model_set_xmin (GwyGraphModel *model, gdouble value);
Sets bounding value for all the curves within model. This value is recomputed while adding curves to the graph depending on actual graph settings.
model : |
A graph model. |
value : |
void gwy_graph_model_set_xmax (GwyGraphModel *model, gdouble value);
Sets bounding value for all the curves within model. This value is recomputed while adding curves to the graph depending on actual graph settings.
model : |
A graph model. |
value : |
void gwy_graph_model_set_ymin (GwyGraphModel *model, gdouble value);
Sets bounding value for all the curves within model. This value is recomputed while adding curves to the graph depending on actual graph settings.
model : |
A graph model. |
value : |
void gwy_graph_model_set_ymax (GwyGraphModel *model, gdouble value);
Sets bounding value for all the curves within model. This value is recomputed while adding curves to the graph depending on actual graph settings.
model : |
A graph model. |
value : |
axis-label-bottom
" property"axis-label-bottom" gchararray : Read / Write
The label of the bottom axis.
Default value: "x"
axis-label-left
" property"axis-label-left" gchararray : Read / Write
The label of the left axis.
Default value: "y"
axis-label-right
" property"axis-label-right" gchararray : Read / Write
The label of the right axis.
Default value: ""
axis-label-top
" property"axis-label-top" gchararray : Read / Write
The label of the top axis.
Default value: ""
n-curves
" property"n-curves" gint : Read
The number of curves in graph model.
Allowed values: [0,100]
Default value: 0
void user_function (GwyGraphModel *gwygraphmodel, gpointer user_data) : Run first
XXX XXX XXX: This bloody signal is emitted whenever anything in the bloody graph changes instead of making the bloody graph model properties real properties and emitting property change notification.
gwygraphmodel : |
The GwyGraphModel which received the signal. |
user_data : |
user data set when the signal handler was connected. |