![]() |
![]() |
![]() |
Gwyddion Widgets Library Reference Manual | ![]() |
---|
GwyAxisGwyAxis — Axis with ticks and labels |
GwyAxisActiveAreaSpecs; GwyAxisTick; GwyAxisLabeledTick; 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); gboolean gwy_axis_is_visible (GwyAxis *axis); gboolean gwy_axis_is_logarithmic (GwyAxis *axis); GtkPositionType gwy_axis_get_orientation (GwyAxis *axis); 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); gdouble gwy_axis_get_magnification (GwyAxis *axis); const gchar* gwy_axis_get_magnification_string (GwyAxis *axis); void gwy_axis_set_label (GwyAxis *axis, const gchar *label); const gchar* gwy_axis_get_label (GwyAxis *axis); void gwy_axis_set_unit (GwyAxis *axis, GwySIUnit *unit); void gwy_axis_enable_label_edit (GwyAxis *axis, gboolean enable); void gwy_axis_draw_on_drawable (GdkDrawable *drawable, GdkGC *gc, gint xmin, gint ymin, gint width, gint height, GwyAxis *axis); GString* gwy_axis_export_vector (GwyAxis *axis, gint xmin, gint ymin, gint width, gint height, gint fontsize); void gwy_axis_set_grid_data (GwyAxis *axis, GArray *array);
"label-updated" void user_function (GwyAxis *gwyaxis, gpointer user_data); "rescaled" void user_function (GwyAxis *gwyaxis, gpointer user_data);
GwyAxis is used for drawing axis. It is namely used within GwyGraph widget, but it can be also used standalone. It plots a horizontal or vertical axis with major and minor ticks, with ranges in the requested interval.
typedef struct { gint xmin; /*x offset of the active area with respect to drawable left border*/ gint ymin; /*y offset of the active area with respect to drawable top border*/ gint height; /*active area height*/ gint width; /*active area width*/ } GwyAxisActiveAreaSpecs;
typedef struct { gdouble value; /*tick value*/ gint scrpos; /*precomputed tick screen position*/ } GwyAxisTick;
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); void (*rescaled)(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 of the axis |
max : |
maximum value of the axis |
label : |
axis label |
Returns : | new axis as a GtkWidget. |
void gwy_axis_set_logarithmic (GwyAxis *axis, gboolean is_logarithmic);
Sets logarithmic mode.
axis : |
graph axis |
is_logarithmic : |
logarithmic mode |
void gwy_axis_set_visible (GwyAxis *axis, gboolean is_visible);
Sets visibility of axis.
axis : |
An axis. |
is_visible : |
visibility |
gboolean gwy_axis_is_visible (GwyAxis *axis);
Determines whether axis is set to be visible.
Return: TRUE
if axis
is set to be visible.
axis : |
An axis. |
Returns : |
gboolean gwy_axis_is_logarithmic (GwyAxis *axis);
Determines whether axis is set to be locarithmic.
axis : |
An axis. |
Returns : | TRUE if axis is logarithmic.
|
GtkPositionType gwy_axis_get_orientation (GwyAxis *axis);
Gets the orientation of an axis.
axis : |
An axis. |
Returns : | The orientation. |
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 : |
An axis. |
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 : |
An axis. |
min : |
minimum requisition (min boundary value) |
max : |
maximum requisition (max boundary value) |
void gwy_axis_set_style (GwyAxis *axis, GwyAxisParams style);
Set axis style. The style affects used tick sizes, fonts etc.
axis : |
An axis. |
style : |
axis style |
gdouble gwy_axis_get_maximum (GwyAxis *axis);
axis : |
An axis. |
Returns : | real maximum of axis |
gdouble gwy_axis_get_minimum (GwyAxis *axis);
axis : |
An axis. |
Returns : | real minimum of axis |
gdouble gwy_axis_get_reqmaximum (GwyAxis *axis);
axis : |
An axis. |
Returns : | axis requisition maximum |
gdouble gwy_axis_get_reqminimum (GwyAxis *axis);
axis : |
An axis. |
Returns : | axis requisition minimum |
gdouble gwy_axis_get_magnification (GwyAxis *axis);
axis : |
Axis widget |
Returns : | Magnification value of the axis |
const gchar* gwy_axis_get_magnification_string (GwyAxis *axis);
Gets the magnification string of an axis.
axis : |
Axis widget |
Returns : | Magnification string of the axis, owned by the axis. |
void gwy_axis_set_label (GwyAxis *axis, const gchar *label);
Sets the label text of an axis.
axis : |
An axis. |
label : |
The new label text (it can be NULL for an empty label).
|
const gchar* gwy_axis_get_label (GwyAxis *axis);
Gets the label of an axis.
axis : |
An axis. |
Returns : | Axis label as a string owned by axis .
|
void gwy_axis_set_unit (GwyAxis *axis, GwySIUnit *unit);
Sets the axis unit. This will be added automatically
to the label. unit
is duplicated.
axis : |
An axis. |
unit : |
axis unit |
void gwy_axis_enable_label_edit (GwyAxis *axis, gboolean enable);
Enables/disables user to change axis label by clicking on axis widget.
axis : |
Axis widget |
enable : |
enable/disable user to change axis label |
void gwy_axis_draw_on_drawable (GdkDrawable *drawable, GdkGC *gc, gint xmin, gint ymin, gint width, gint height, GwyAxis *axis);
Draws the x and y-axis on a drawable
drawable : |
a GdkDrawable |
gc : |
a GdkGC graphics context |
xmin : |
The minimum x-axis value. |
ymin : |
The minimum y-axis value. |
width : |
The width of the x-axis. |
height : |
The height of the y-axis. |
axis : |
An axis. |
GString* gwy_axis_export_vector (GwyAxis *axis, gint xmin, gint ymin, gint width, gint height, gint fontsize);
axis : |
Axis widget |
xmin : |
minimum value of x-axis |
ymin : |
minimum value of y-axis |
width : |
width of the x-axis |
height : |
hieght of the y-axis |
fontsize : |
the fontsize |
Returns : | Magnification string of the axis |
<< GwyGraphArea | GwyAxisDialog >> |