![]() |
![]() |
![]() |
Gwyddion Widgets Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
#include <libgwydgets/gwydgets.h> struct GwyAxis; struct GwyAxisClass; GwyAxisParams; GtkWidget * gwy_axis_new (gint orientation
); 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_request_range (GwyAxis *axis
,gdouble min
,gdouble max
); void gwy_axis_get_range (GwyAxis *axis
,gdouble *min
,gdouble *max
); void gwy_axis_get_requested_range (GwyAxis *axis
,gdouble *min
,gdouble *max
); 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_si_unit (GwyAxis *axis
,GwySIUnit *unit
); void gwy_axis_enable_label_edit (GwyAxis *axis
,gboolean enable
); void gwy_axis_draw_on_drawable (GwyAxis *axis
,GdkDrawable *drawable
,GdkGC *gc
,gint xmin
,gint ymin
,gint width
,gint height
); GString * gwy_axis_export_vector (GwyAxis *axis
,gint xmin
,gint ymin
,gint width
,gint height
,gint fontsize
); const gdouble * gwy_axis_get_major_ticks (GwyAxis *axis
,guint *nticks
);
"auto" gboolean : Read / Write "label" gchar* : Read / Write "line-thickness" gint : Read / Write "major-length" gint : Read / Write "major-maxticks" gint : Read / Write "major-thickness" gint : Read / Write "minor-division" gint : Read / Write "minor-length" gint : Read / Write "minor-thickness" gint : Read / Write "outer-border-width" gint : Read / Write
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.
struct GwyAxisClass { GtkWidgetClass parent_class; void (*rescaled)(GwyAxis *axis); void (*reserved1)(void); void (*reserved2)(void); };
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;
GtkWidget * gwy_axis_new (gint orientation
);
Creates a new axis.
|
axis orientation |
Returns : |
New axis as a GtkWidget. |
void gwy_axis_set_logarithmic (GwyAxis *axis
,gboolean is_logarithmic
);
Sets logarithmic mode.
|
graph axis |
|
logarithmic mode |
void gwy_axis_set_visible (GwyAxis *axis
,gboolean is_visible
);
Sets the visibility of an axis.
|
An axis. |
|
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.
|
An axis. |
gboolean gwy_axis_is_logarithmic (GwyAxis *axis
);
Determines whether axis is set to be locarithmic.
|
An axis. |
Returns : |
TRUE if axis is logarithmic. |
GtkPositionType gwy_axis_get_orientation (GwyAxis *axis
);
Gets the orientation of an axis.
|
An axis. |
Returns : |
The orientation. |
void gwy_axis_set_auto (GwyAxis *axis
,gboolean is_auto
);
Enables or disables automatic axis adjustmet.
void gwy_axis_request_range (GwyAxis *axis
,gdouble min
,gdouble max
);
Sets the requisition of axis boundaries.
The axis will adjust the boundaries to satisfy requisition but still have
reasonable tick values and spacing. Use gwy_axis_get_range()
to obtain the
boundaries the axis actually decided to use.
|
An axis. |
|
Minimum requisition (min boundary value). |
|
Maximum requisition (max boundary value). |
void gwy_axis_get_range (GwyAxis *axis
,gdouble *min
,gdouble *max
);
Gets the actual boundaries of an axis.
void gwy_axis_get_requested_range (GwyAxis *axis
,gdouble *min
,gdouble *max
);
Gets the requested boundaries of an axis.
gdouble gwy_axis_get_magnification (GwyAxis *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.
|
An axis. |
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.
|
An axis. |
|
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.
|
An axis. |
Returns : |
Axis label as a string owned by axis . |
void gwy_axis_set_si_unit (GwyAxis *axis
,GwySIUnit *unit
);
Sets the axis unit. This will be added automatically
to the label. unit
is duplicated.
|
An axis. |
|
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 widget |
|
enable/disable user to change axis label |
void gwy_axis_draw_on_drawable (GwyAxis *axis
,GdkDrawable *drawable
,GdkGC *gc
,gint xmin
,gint ymin
,gint width
,gint height
);
Draws the x and y-axis on a drawable
|
An axis. |
|
Drawable to draw on. |
|
Graphics context. It is modified by this function unpredictably. |
|
The minimum x-axis value. |
|
The minimum y-axis value. |
|
The width of the x-axis. |
|
The height of the y-axis. |
GString * gwy_axis_export_vector (GwyAxis *axis
,gint xmin
,gint ymin
,gint width
,gint height
,gint fontsize
);
|
An axis. |
|
width of the x-axis |
|
hieght of the y-axis |
const gdouble * gwy_axis_get_major_ticks (GwyAxis *axis
,guint *nticks
);
Gets the positions of major ticks of an axis.
|
An axis. |
|
Location to store the number of returned ticks. |
Returns : |
The positions of axis major ticks (as real values, not pixels). The returned array is owned by the axis. |
"auto"
property"auto" gboolean : Read / Write
Autoscale ticks with changing content.
Default value: TRUE
"line-thickness"
property"line-thickness" gint : Read / Write
Axis main line thickness.
Allowed values: [0,20]
Default value: 5
"major-length"
property"major-length" gint : Read / Write
Major ticks length.
Allowed values: [0,20]
Default value: 5
"major-maxticks"
property"major-maxticks" gint : Read / Write
Major ticks maximum number.
Allowed values: [0,50]
Default value: 5
"major-thickness"
property"major-thickness" gint : Read / Write
Major ticks thickness.
Allowed values: [0,20]
Default value: 5
"minor-division"
property"minor-division" gint : Read / Write
Minor ticks division.
Allowed values: [0,20]
Default value: 5
"minor-length"
property"minor-length" gint : Read / Write
Minor ticks length.
Allowed values: [0,20]
Default value: 5
"minor-thickness"
property"minor-thickness" gint : Read / Write
Minor ticks thickness.
Allowed values: [0,20]
Default value: 5
"outer-border-width"
property"outer-border-width" gint : Read / Write
The extra amount of space left on the outer side of an axis. This space is also retained when axis is set non-visible.
Allowed values: >= 0
Default value: 5