![]() |
![]() |
![]() |
Gwyddion Widgets Library Reference Manual | ![]() |
---|---|---|---|---|
#define GWY_AXIS_NORTH #define GWY_AXIS_SOUTH #define GWY_AXIS_EAST #define GWY_AXIS_WEST enum GwyAxisScaleFormat; GwyTick; GwyLabeledTick; GwyAxisParams; GwyAxis; GwyAxisClass; GtkWidget* gwy_axis_new (gint orientation, gdouble min, gdouble max, const gchar *label); void gwy_axis_set_logarithmic (GwyAxis *axis, gboolean is_logarithmic); void gwy_axis_set_visible (GwyAxis *axis, gboolean is_visible); void gwy_axis_set_auto (GwyAxis *axis, gboolean is_auto); void gwy_axis_set_req (GwyAxis *axis, gdouble min, gdouble max); void gwy_axis_set_style (GwyAxis *axis, GwyAxisParams style); gdouble gwy_axis_get_maximum (GwyAxis *axis); gdouble gwy_axis_get_minimum (GwyAxis *axis); gdouble gwy_axis_get_reqmaximum (GwyAxis *axis); gdouble gwy_axis_get_reqminimum (GwyAxis *axis); void gwy_axis_set_label (GwyAxis *axis, GString *label_text); GString* gwy_axis_get_label (GwyAxis *axis); void gwy_axis_set_unit (GwyAxis *axis, char *unit); void gwy_axis_enable_label_edit (GwyAxis *axis, gboolean enable);
This widget is used for drawing axis. It is namely used within GwyGraph widget, byt it can be also used separately. It plots a horizontal or vertical axis with amjor and minor ticks, with ranges in the requested interval.
typedef enum { GWY_AXIS_FLOAT = 1, GWY_AXIS_EXP, GWY_AXIS_INT, GWY_AXIS_AUTO } GwyAxisScaleFormat;
Labeled axis tick mark format.
typedef struct { gdouble value; /*tick value*/ gint scrpos; /*precomputed tick screen position*/ } GwyTick;
typedef struct { gint major_length; gint major_thickness; gint major_maxticks; GwyAxisScaleFormat major_printmode; gint minor_length; gint minor_thickness; gint minor_division; /*minor division*/ gint line_thickness; PangoFontDescription *major_font; PangoFontDescription *label_font; } GwyAxisParams;
typedef struct { GtkWidgetClass parent_class; void (*label_updated)(GwyAxis *axis); gpointer reserved1; gpointer reserved2; } GwyAxisClass;
GtkWidget* gwy_axis_new (gint orientation, gdouble min, gdouble max, const gchar *label);
Creates new axis.
orientation : |
axis orientation |
min : |
minimum value |
max : |
maximum value |
label : |
axis label |
Returns : | new axis |
void gwy_axis_set_logarithmic (GwyAxis *axis, gboolean is_logarithmic);
Sets logarithmic mode. Untested.
axis : |
axis |
is_logarithmic : |
logarithimc mode |
void gwy_axis_set_visible (GwyAxis *axis, gboolean is_visible);
Sets visibility of axis.
axis : |
axis widget |
is_visible : |
visibility |
void gwy_axis_set_auto (GwyAxis *axis, gboolean is_auto);
Sets the auto property. If TRUE, axis changes fonts and ticks sizes to produce reasonable output at different widget sizes.
axis : |
axis widget |
is_auto : |
auto preperty |
void gwy_axis_set_req (GwyAxis *axis, gdouble min, gdouble max);
Set requisition of axis boundaries. Axis will fix the boundaries to satisfy requisition but still have reasonable tick values and spacing.
axis : |
axis widget |
min : |
minimum requisistion |
max : |
maximum requisition |
void gwy_axis_set_style (GwyAxis *axis, GwyAxisParams style);
Set axis style. The style affects used tick sizes, fonts etc.
axis : |
axis widget |
style : |
axis style |
gdouble gwy_axis_get_maximum (GwyAxis *axis);
axis : |
axis widget |
Returns : | real maximum of axis |
gdouble gwy_axis_get_minimum (GwyAxis *axis);
axis : |
axis widget |
Returns : | real minimum of axis |
gdouble gwy_axis_get_reqmaximum (GwyAxis *axis);
axis : |
axis widget |
Returns : | axis requisition maximum |
gdouble gwy_axis_get_reqminimum (GwyAxis *axis);
axis : |
axis widget |
Returns : | axis requisition minimum |
void gwy_axis_set_label (GwyAxis *axis, GString *label_text);
sets the label text
axis : |
axis widget |
label_text : |
label to be set |
GString* gwy_axis_get_label (GwyAxis *axis);
axis : |
axis widget |
Returns : | axis label string |
void gwy_axis_set_unit (GwyAxis *axis, char *unit);
Sets the label unit. This will be added automatically to the label.
axis : |
axis widget |
unit : |
label unit |