| Gwyddion Widgets Library Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals | ||||
#include <libgwydgets/gwydgets.h> struct GwyGraphModel; struct 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_units_from_data_line (GwyGraphModel *model,GwyDataLine *data_line); gboolean gwy_graph_model_x_data_can_be_logarithmed (GwyGraphModel *model); gboolean gwy_graph_model_y_data_can_be_logarithmed (GwyGraphModel *model); void gwy_graph_model_set_axis_label (GwyGraphModel *model,GtkPositionType pos,const gchar *label); const gchar * gwy_graph_model_get_axis_label (GwyGraphModel *model,GtkPositionType pos); gboolean gwy_graph_model_get_x_range (GwyGraphModel *gmodel,gdouble *x_min,gdouble *x_max); gboolean gwy_graph_model_get_y_range (GwyGraphModel *gmodel,gdouble *y_min,gdouble *y_max); gboolean gwy_graph_model_get_ranges (GwyGraphModel *gmodel,gboolean x_logscale,gboolean y_logscale,gdouble *x_min,gdouble *x_max,gdouble *y_min,gdouble *y_max); GString * gwy_graph_model_export_ascii (GwyGraphModel *model,gboolean export_units,gboolean export_labels,gboolean export_metadata,GwyGraphModelExportStyle export_style,GString *string);
"axis-label-bottom" gchar* : Read / Write "axis-label-left" gchar* : Read / Write "axis-label-right" gchar* : Read / Write "axis-label-top" gchar* : Read / Write "grid-type" GwyGraphGridType : Read / Write "label-frame-thickness" gint : Read / Write "label-has-frame" gboolean : Read / Write "label-position" GwyGraphLabelPosition : Read / Write "label-reverse" gboolean : Read / Write "label-visible" gboolean : Read / Write "n-curves" guint : Read "si-unit-x" GwySIUnit* : Read / Write "si-unit-y" GwySIUnit* : Read / Write "title" gchar* : Read / Write "x-logarithmic" gboolean : Read / Write "x-max" gdouble : Read / Write "x-max-set" gboolean : Read / Write "x-min" gdouble : Read / Write "x-min-set" gboolean : Read / Write "y-logarithmic" gboolean : Read / Write "y-max" gdouble : Read / Write "y-max-set" gboolean : Read / Write "y-min" gdouble : Read / Write "y-min-set" gboolean : Read / Write
struct GwyGraphModelClass {
GObjectClass parent_class;
void (*curve_data_changed)(GwyGraphModel *model,
gint i);
void (*curve_notify)(GwyGraphModel *model,
gint i,
GParamSpec *pspec);
void (*reserved1)(void);
void (*reserved2)(void);
void (*reserved3)(void);
void (*reserved4)(void);
};
#define gwy_graph_model_duplicate(gmodel)
Convenience macro doing gwy_serializable_duplicate() with all the necessary
typecasting.
|
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.
|
A graph model. |
Returns : |
New graph model. |
gint gwy_graph_model_get_n_curves (GwyGraphModel *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.
|
A graph model. |
|
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.
|
A graph model. |
|
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.
|
A graph model. |
|
Curve index in graph model. |
GwyGraphCurveModel * gwy_graph_model_get_curve_by_description (GwyGraphModel *gmodel,const gchar *description);
|
A graph model. |
|
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.
|
A graph model. |
|
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.
|
A graph model. |
|
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
|
A graph model. |
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.
|
A graph model. |
|
A data line to take units from. |
gboolean gwy_graph_model_x_data_can_be_logarithmed
(GwyGraphModel *model);
Checks whehter x axis can be lograrithmed.
|
A graph model. |
Returns : |
TRUE if all x-values are greater than zero (thus logarithmic display of x-data is feasible). |
gboolean gwy_graph_model_y_data_can_be_logarithmed
(GwyGraphModel *model);
Checks whehter y axis can be lograrithmed.
|
A graph model. |
Returns : |
TRUE if all y-values are greater than zero (thus logarithmic display of y-data is feasible). |
void gwy_graph_model_set_axis_label (GwyGraphModel *model,GtkPositionType pos,const gchar *label);
Sets one axis label of a graph model.
|
A graph model. |
|
Axis position. |
|
The new label. |
const gchar * gwy_graph_model_get_axis_label (GwyGraphModel *model,GtkPositionType pos);
Gets the label of a one graph model axis.
|
A graph model. |
|
Axis position. |
Returns : |
The label as a string owned by the model. |
gboolean gwy_graph_model_get_x_range (GwyGraphModel *gmodel,gdouble *x_min,gdouble *x_max);
Gets the abscissa range of a graph.
Explicitly set minimum and maximum range properties take precedence over values calculated from curve abscissa ranges.
gboolean gwy_graph_model_get_y_range (GwyGraphModel *gmodel,gdouble *y_min,gdouble *y_max);
Gets the ordinate range of a graph.
Explicitly set minimum and maximum range properties take precedence over values calculated from curve ordinate ranges.
gboolean gwy_graph_model_get_ranges (GwyGraphModel *gmodel,gboolean x_logscale,gboolean y_logscale,gdouble *x_min,gdouble *x_max,gdouble *y_min,gdouble *y_max);
Gets the log-scale suitable range minima of a graph curve.
See gwy_graph_curve_model_get_ranges() for discussion.
|
A graph model. |
|
TRUE if logarithmical scale is intended for the abscissa. |
|
TRUE if logarithmical scale is intended for the ordinate. |
|
Location to store the minimum abscissa value, or NULL. |
|
Location to store the maximum abscissa value, or NULL. |
|
Location to store the minimum ordinate value, or NULL. |
|
Location to store the maximum ordinate value, or NULL. |
Returns : |
TRUE if all requested output arguments were filled with the
ranges. |
Since 2.8
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.
|
A graph model. |
|
TRUE to export units in the column header. |
|
TRUE to export labels in the column header. |
|
TRUE to export all graph metadata within file header. |
|
File format subtype to export to (e. g. plain, csv, gnuplot, etc.). |
|
A string to append the text dump to, or NULL to allocate a new
string. |
Returns : |
Either string itself if it was not NULL, or a newly allocated
GString. |
"axis-label-bottom" property"axis-label-bottom" gchar* : Read / Write
The label of the bottom axis.
Default value: "x"
"axis-label-left" property"axis-label-left" gchar* : Read / Write
The label of the left axis.
Default value: "y"
"axis-label-right" property"axis-label-right" gchar* : Read / Write
The label of the right axis.
Default value: ""
"axis-label-top" property"axis-label-top" gchar* : Read / Write
The label of the top axis.
Default value: ""
"grid-type" property"grid-type" GwyGraphGridType : Read / Write
Type of grid drawn on main graph area.
Default value: GWY_GRAPH_GRID_AUTO
"label-frame-thickness" property"label-frame-thickness" gint : Read / Write
Thickness of key label frame.
Allowed values: [0,16]
Default value: 1
"label-has-frame" property"label-has-frame" gboolean : Read / Write
TRUE if key label has frame.
Default value: TRUE
"label-position" property"label-position" GwyGraphLabelPosition : Read / Write
Position type of key label.
Default value: GWY_GRAPH_LABEL_NORTHEAST
"label-reverse" property"label-reverse" gboolean : Read / Write
TRUE if text and curve sample is switched in key.
Default value: FALSE
"label-visible" property"label-visible" gboolean : Read / Write
TRUE if key label is visible.
Default value: TRUE
"n-curves" property"n-curves" guint : Read
The number of curves in graph model.
Default value: 0
"si-unit-x" property"si-unit-x" GwySIUnit* : Read / Write
Unit of x axis. Units are always passed by value, the unit object has a different identity than the object owned by the graph model.
"si-unit-y" property"si-unit-y" GwySIUnit* : Read / Write
Unit of y axis. Units are always passed by value, the unit object has a different identity than the object owned by the graph model.
"x-logarithmic" property"x-logarithmic" gboolean : Read / Write
TRUE if x coordinate is logarithimic.
Default value: FALSE
"x-max-set" property"x-max-set" gboolean : Read / Write
Whether x-max is set.
Default value: FALSE
"x-min-set" property"x-min-set" gboolean : Read / Write
Whether x-min is set.
Default value: FALSE
"y-logarithmic" property"y-logarithmic" gboolean : Read / Write
TRUE if y coordinate is logarithimic.
Default value: FALSE
"y-max-set" property"y-max-set" gboolean : Read / Write
Whether y-max is set.
Default value: FALSE
"y-min-set" property"y-min-set" gboolean : Read / Write
Whether y-min is set.
Default value: FALSE
"curve-data-changed" signalvoid user_function (GwyGraphModel *gwygraphmodel,
gint arg1,
gpointer user_data) : Run First
The ::curve-data-changed signal is emitted whenever any of the curves in a graph model emits "data-changed".
|
The GwyGraphModel which received the signal. |
|
The index of the changed curve in the model. |
|
user data set when the signal handler was connected. |
"curve-notify" signalvoid user_function (GwyGraphModel *gwygraphmodel,
gint arg1,
GParamSpec *arg2,
gpointer user_data) : Run First
The ::curve-data-changed signal is emitted whenever any of the curves in a graph model emits "notify".
|
The GwyGraphModel which received the signal. |
|
The index of the changed curve in the model. |
|
The GParamSpec of the property that has changed. |
|
user data set when the signal handler was connected. |