![]() | ![]() | ![]() | Gwyddion Widgets Library Reference Manual | ![]() |
---|
GwyGraph — Widget for displaying graphs
struct GwyGraphAutoProperties; struct GwyGraph; struct GwyGraphClass; GtkWidget* gwy_graph_new (); void gwy_graph_add_dataline_with_units (GwyGraph *graph, GwyDataLine *dataline, gdouble shift, GString *label, GwyGraphAreaCurveParams *params, gdouble x_order, gdouble y_order, char *x_unit, char *y_unit); void gwy_graph_add_dataline (GwyGraph *graph, GwyDataLine *dataline, gdouble shift, GString *label, GwyGraphAreaCurveParams *params); void gwy_graph_add_datavalues (GwyGraph *graph, gdouble *xvals, gdouble *yvals, gint n, GString *label, GwyGraphAreaCurveParams *params); void gwy_graph_clear (GwyGraph *graph); void gwy_graph_set_autoproperties (GwyGraph *graph, GwyGraphAutoProperties *autoproperties); void gwy_graph_get_autoproperties (GwyGraph *graph, GwyGraphAutoProperties *autoproperties); void gwy_graph_export_ascii (GwyGraph *graph, const char *filename); void gwy_graph_set_status (GwyGraph *graph, GwyGraphStatusType status); GwyGraphStatusType gwy_graph_get_status (GwyGraph *graph); gpointer gwy_graph_get_status_data (GwyGraph *graph); void gwy_graph_get_boundaries (GwyGraph *graph, gdouble *x_min, gdouble *x_max, gdouble *y_min, gdouble *y_max); void gwy_graph_set_boundaries (GwyGraph *graph, gdouble x_min, gdouble x_max, gdouble y_min, gdouble y_max); void gwy_graph_unzoom (GwyGraph *graph); void gwy_graph_get_data (GwyGraph *graph, gdouble *xval, gdouble *yval, gint curve); gint gwy_graph_get_data_size (GwyGraph *graph, gint curve); gint gwy_graph_get_number_of_curves (GwyGraph *graph); GString* gwy_graph_get_label (GwyGraph *graph, gint curve); void gwy_graph_enable_axis_label_edit (GwyGraph *graph, gboolean enable);
GObject +----GtkObject +----GtkWidget +----GtkContainer +----GtkTable +----GwyGraph
GwyGraph is basic widget for displaying graphs. It consist of several widgets that can be also used sparately. However, it is recomended (and it should be easy) to use whole GwyGraph widget and its API for most of the purposes.
GwyGraph is still in developement. Basic functionality and API is however allready set up. In the future, more API functions will be introduced probably.
struct GwyGraphAutoProperties { gboolean is_line; gboolean is_point; gint line_size; gint point_size; GdkColor color; };
This structure corresponds to settings of display mode of data that are added with no specific display mode requests (lines/points, line color, etc.). For these data, drawing properties are determined automatically, in order to make curves distinguishable. These automatically generated curve properties are saved here.
struct GwyGraphClass { GtkTableClass parent_class; void (*gwygraph)(GwyGraph *graph); gpointer reserved1; gpointer reserved2; };
void gwy_graph_add_dataline_with_units (GwyGraph *graph, GwyDataLine *dataline, gdouble shift, GString *label, GwyGraphAreaCurveParams *params, gdouble x_order, gdouble y_order, char *x_unit, char *y_unit);
Adds a datalien into graph, setting units. Original dataline data will be divided by x_order and y_order factors and axis labels will have requested units.
graph : | graph widget |
dataline : | dataline to be added |
shift : | x shift (dataline starts allways at zero) |
label : | curve label |
params : | parameters of curve (lines/points etc.) |
x_order : | division factor to obtain values corresponding to units |
y_order : | division factor to obtain values corresponding to units |
x_unit : | unit at x axis |
y_unit : | unit at y axis |
void gwy_graph_add_dataline (GwyGraph *graph, GwyDataLine *dataline, gdouble shift, GString *label, GwyGraphAreaCurveParams *params);
Adds a dataline into graph.
graph : | graph widget |
dataline : | dataline to be added |
shift : | x shift (dataline starts allways at zero) |
label : | curve label |
params : | parameters of curve (lines/points etc.) |
void gwy_graph_add_datavalues (GwyGraph *graph, gdouble *xvals, gdouble *yvals, gint n, GString *label, GwyGraphAreaCurveParams *params);
Adds raw data to the graph. Data are represented by two arrays of same size.
graph : | graph widget |
xvals : | x values |
yvals : | y values |
n : | number of values |
label : | curve label |
params : | arameters of curve (lines/points etc.) |
void gwy_graph_set_autoproperties (GwyGraph *graph, GwyGraphAutoProperties *autoproperties);
Sets the autoproperties - properties of curves added with no specification (color, point/line draw, etc.).
graph : | graph widget |
autoproperties : | autoproperties of graph |
void gwy_graph_get_autoproperties (GwyGraph *graph, GwyGraphAutoProperties *autoproperties);
Gets the autoproperties - properties of curves added with no specification (color, point/line draw, etc.).
graph : | graph widget |
autoproperties : | autoproperties of graph |
void gwy_graph_export_ascii (GwyGraph *graph, const char *filename);
graph : | |
filename : |
void gwy_graph_set_status (GwyGraph *graph, GwyGraphStatusType status);
sets the graph status. The status is related with ability to do different mouse selections.
graph : | graph widget |
status : | graph status to be set |
GwyGraphStatusType gwy_graph_get_status (GwyGraph *graph);
gets the graph status. The status is related with ability to do different mouse selections.
graph : | graph widget |
Returns : | current graph status |
gpointer gwy_graph_get_status_data (GwyGraph *graph);
gets the graph status data - data corresponding to mouse selections done by user. Actual contain cooresponds on status type.
graph : | graph widget |
Returns : | pointer to status data. |
void gwy_graph_get_boundaries (GwyGraph *graph, gdouble *x_min, gdouble *x_max, gdouble *y_min, gdouble *y_max);
graph : | graph widget |
x_min : | x axis minimum value |
x_max : | x axis maximum value |
y_min : | y axis minimum value |
y_max : | y axis maximum value |
void gwy_graph_set_boundaries (GwyGraph *graph, gdouble x_min, gdouble x_max, gdouble y_min, gdouble y_max);
Sets actual axis boundaries of graph. Recomputes and redisplays all necessary things.
graph : | graph widget |
x_min : | x axis minimum value |
x_max : | x axis maximum value |
y_min : | y axis minimum value |
y_max : | y axis maximum value |
void gwy_graph_unzoom (GwyGraph *graph);
resets zoom. Fits all curves into graph.
graph : | graph widget |
void gwy_graph_get_data (GwyGraph *graph, gdouble *xval, gdouble *yval, gint curve);
Extracts data of a curve.
graph : | graph widget |
xval : | x data points |
yval : | y data points |
curve : | curve to be extracted |
gint gwy_graph_get_data_size (GwyGraph *graph, gint curve);
graph : | |
curve : | |
Returns : |
gint gwy_graph_get_number_of_curves (GwyGraph *graph);
graph : | graph widget |
Returns : | total number of curves within graph widget |
GString* gwy_graph_get_label (GwyGraph *graph, gint curve);
Return the label of a graph curve.
graph : | A graph wiget. |
curve : | Graph curve to get label of. |
Returns : | The label as a GString. Note the label itself is returned, not a copy, you should treat it as constat. |
void gwy_graph_enable_axis_label_edit (GwyGraph *graph, gboolean enable);
graph : | |
enable : |
<< GwyGraphLabel | GwyGraphModel >> |