GwyGraphBasics — Common graph functions and utilities
void | gwy_graph_draw_point () |
void | gwy_graph_draw_line () |
void | gwy_graph_draw_curve () |
void | gwy_graph_draw_selection_points () |
void | gwy_graph_draw_selection_areas () |
void | gwy_graph_draw_selection_lines () |
void | gwy_graph_draw_selection_xareas () |
void | gwy_graph_draw_selection_yareas () |
void | gwy_graph_draw_grid () |
const GwyRGBA * | gwy_graph_get_preset_color () |
guint | gwy_graph_get_n_preset_colors () |
GwyGraphActiveAreaSpecs |
#include <libgwydgets/gwydgets.h>
void gwy_graph_draw_point (GdkDrawable *drawable
,GdkGC *gc
,gint x
,gint y
,GwyGraphPointType type
,gint size
,const GwyRGBA *color
);
Draws a point on a drawable.
drawable |
A drawable. |
|
gc |
Graphics context. It is modified by this function unpredictably. |
|
x |
X coordinate of the point. |
|
y |
Y coordinate of the point. |
|
type |
graph point type |
|
size |
point size |
|
color |
point color |
void gwy_graph_draw_line (GdkDrawable *drawable
,GdkGC *gc
,gint x_from
,gint y_from
,gint x_to
,gint y_to
,GdkLineStyle line_style
,gint size
,const GwyRGBA *color
);
Draws a line segment on a drawable.
drawable |
A drawable. |
|
gc |
Graphics context. It is modified by this function unpredictably. |
|
x_from |
x coordinate of the start point of the line |
|
y_from |
y coordinate of the start point of the line |
|
x_to |
x coordinate of the end point of the line |
|
y_to |
y coordinate of the end point of the line |
|
line_style |
graph line style |
|
size |
point size |
|
color |
point color |
void gwy_graph_draw_curve (GdkDrawable *drawable
,GdkGC *gc
,GwyGraphActiveAreaSpecs *specs
,GwyGraphCurveModel *gcmodel
);
Draws a single graph curve on a drawable.
drawable |
A drawable. |
|
gc |
Graphics context. It is modified by this function unpredictably. |
|
specs |
Specifications (boundaries) of the active area of the graph. |
|
gcmodel |
Curve model of the curve to draw. |
void gwy_graph_draw_selection_points (GdkDrawable *drawable
,GdkGC *gc
,GwyGraphActiveAreaSpecs *specs
,GwySelectionGraphPoint *selection
);
Draws selection points on a drawable.
drawable |
A drawable. |
|
gc |
Graphics context. |
|
specs |
Specifications (boundaries) of the active area of the graph. |
|
selection |
A selection of type GwySelectionGraphPoint. |
void gwy_graph_draw_selection_areas (GdkDrawable *drawable
,GdkGC *gc
,GwyGraphActiveAreaSpecs *specs
,GwySelectionGraphArea *selection
);
Draws selected area on a drawable.
drawable |
A drawable. |
|
gc |
Graphics context. It is modified by this function unpredictably. |
|
specs |
Specifications (boundaries) of the active area of the graph. |
|
selection |
A selection of type GwySelectionGraphArea. |
void gwy_graph_draw_selection_lines (GdkDrawable *drawable
,GdkGC *gc
,GwyGraphActiveAreaSpecs *specs
,GwySelectionGraphLine *selection
,GtkOrientation orientation
);
Draws selected lines on a drawable.
drawable |
A drawable. |
|
gc |
Graphics context. It is modified by this function unpredictably. |
|
specs |
Specifications (boundaries) of the active area of the graph. |
|
selection |
a GwySelectionGraphLine structure |
|
orientation |
horizontal or vertical orientation |
void gwy_graph_draw_selection_xareas (GdkDrawable *drawable
,GdkGC *gc
,GwyGraphActiveAreaSpecs *specs
,GwySelectionGraph1DArea *selection
);
Draws selected x-area on a drawable.
drawable |
A drawable. |
|
gc |
Graphics context. It is modified by this function unpredictably. |
|
specs |
Specifications (boundaries) of the active area of the graph. |
|
selection |
A selection of type GwySelectionGraph1DArea. |
void gwy_graph_draw_selection_yareas (GdkDrawable *drawable
,GdkGC *gc
,GwyGraphActiveAreaSpecs *specs
,GwySelectionGraph1DArea *selection
);
Drawss selected y-area on a drawable.
drawable |
A drawable. |
|
gc |
Graphics context. It is modified by this function unpredictably. |
|
specs |
Specifications (boundaries) of the active area of the graph. |
|
selection |
A selection of type GwySelectionGraph1DArea. |
void gwy_graph_draw_grid (GdkDrawable *drawable
,GdkGC *gc
,GwyGraphActiveAreaSpecs *specs
,guint nxdata
,const gdouble *x_grid_data
,guint nydata
,const gdouble *y_grid_data
);
Draws an array of grid lines on a drawable.
drawable |
A drawable. |
|
gc |
Graphics context. It is modified by this function unpredictably. |
|
specs |
Specifications (boundaries) of the active area of the graph. |
|
nxdata |
Number of x grid positions. |
|
x_grid_data |
Array of grid data for the x-axis, it can be |
|
nydata |
Number of y grid positions. |
|
y_grid_data |
Array of grid data for the y-axis, it can be |
const GwyRGBA *
gwy_graph_get_preset_color (guint i
);
Gets a preset graph color.
Preset colors are a set of selected colors one can use to distingush graph curves when there is no reason to prefer a particular color. Note they can occasionally change between version, even their number can change.
i |
Color number, starting from 0 which is always black. It can be any
number but colors start to repeat after
|
A constant color that must not be neither modified nor freed.
guint
gwy_graph_get_n_preset_colors (void
);
Gets the number of distinct colors gwy_graph_get_preset_color()
can return.
The number of distinct colors.
typedef struct { gint xmin; gint ymin; gint height; gint width; gdouble real_xmin; gdouble real_ymin; gdouble real_height; gdouble real_width; gboolean log_x; gboolean log_y; } GwyGraphActiveAreaSpecs;
Graph area specification (for graph drawing primitives).
gint |
X offset of the active area with respect to drawable left border. |
|
gint |
Y offset of the active area with respect to drawable top border. |
|
gint |
Active area height in pixels. |
|
gint |
Active area width pixels. |
|
gdouble |
Minimum x value in real units. |
|
gdouble |
Minimum y value in real units. |
|
gdouble |
Area height in real units. |
|
gdouble |
Area width in real units. |
|
gboolean |
|
|
gboolean |
|