wn_axis_label(_c)
status.i4.v = wn_axis_label(plane.i4.r, num_major.i4.r, num_minor.i4.r,
grid_it.i4.r, text.i1a.r, text_size.i4.r,
text_color.i4.r, label_length.i4.r,
label_type.i4.r [,loc_major.r4a.r]
[,squeeze_it.i4.r] [,tick_length.r4.r]
[,loc_minor.r4a.r] [,invert_ticks.i4.r]
[,grid_line_typ.i4.r] [,label_color.i4.r]
[,options.u4.r])
status.i4.v = wn_axis_label_c(plane.i4.v, num_major.i4.v,
num_minor.i4.v, grid_it.i4.v, text.i1a.r,
text_size.i4.v, text_color.i4.v,
label_length.i4.v, label_type.i4.v
[,loc_major.r4a.r] [,squeeze_it.i4.v]
[,tick_length.r4.r] [,loc_minor.r4a.r]
[,invert_ticks.i4.v]
[,grid_line_typ.i4.v] [,label_color.i4.v]
[,options.u4.v])
This routine draws an axis and makes tick marks and optional grids
on the active window. The major axis ticks are enumerated and a
label is put on the axis. There's no checking to see if labeling
will fit on the screen. Use the test page (D110) to test your layout.
Note that the color of the axis and grid lines will be the color
selected by the most recent call to wn_color(_c).
plane axis to label
(WN_HORZ -> horizontal axis (bottom of window),
WN_VERT -> vertical axis (left side of window),
WN_HORZ_TOP -> horizontal axis (top of window),
WN_VERT_RIGHT -> vertical axis (right side of window))
num_major number of intervals between major ticks/grids
num_minor number of intervals between each minor tick
(If "loc_minor" is specified and does not have a value
of NULL, "num_minor" indicates the total number of
minor tick mark values passed in "loc_minor".)
grid_it grid flag
(FALSE -> no grid,
TRUE -> grid on major ticks)
text null terminated axis title text
(A value of NULL may be passed if no title is desired.)
text_size size of title text (same as wn_text_size(_c) sizes)
text_color color of title text
label_length number of tick label characters displayed
label_type type of numeric display for tick labels
(CNV_FLOAT -> regular float format,
CNV_EXP -> exponential notation,
CNV_FLOAT_EXP -> use regular float format unless the
value exceeds "label_length"
characters in which case use
exponential notation)
[loc_major] array ("num_major" + 1 elements) of real world
coordinates defining locations for each major
axis tick/grid mark (Default is NULL which results
in a simple division of the size of the window
by the number of major ticks.)
[squeeze_it] adjust min/max axis label positions to fit limits
of plot window
(WN_SQUEEZE_NO_LABEL -> no adjustment (center label
on grid) (default),
WN_SQUEEZE_X_LABEL -> squeeze x axis labels,
WN_SQUEEZE_Y_LABEL -> squeeze y axis labels,
WN_SQUEEZE_BOTH_LABELS -> squeeze x and y axis labels)
[tick_length] length of tick marks in terms of the real world
coordinates for the opposite plane to the axis plane
(Default is NULL which results in a ratio of 0.04
for the length of the tick marks relative to the
entire width of the window.)
[loc_minor] array ("num_minor" + 1 elements) of real world
coordinates defining locations for each minor axis
tick mark (Default is NULL which results in a
simple division of the size of the window by the
number of major ticks times the number of minor ticks.)
[invert_ticks] tick mark direction flag
(FALSE -> draw tick marks on the inside of the
grid (default),
TRUE -> draw tick marks on the outside of the grid)
[grid_line_typ] type of line for major grid lines
(WN_SOLID_LINE -> solid lines (default),
WN_DOTTED_LINE -> dotted lines)
[label_color] color of axis label text (default (CLIB_DEFAULT_ARG)
is the same as the color of the axis lines which is
the the color most recently selected by a call to
wn_color(_c))
[options] miscellaneous setup options (Note: The following
values can be logically OR'ed together.)
(WN_OPT_NONE -> no options selected,
WN_LIMIT_LABELS_ONLY -> only label the limits of
the axis,
WN_ROUND_VALUES -> round label values to the nearest
integer,
WN_ROUND_VALUES_IF_NEEDED -> round label values to the
nearest integer if it
won't fit into the
available label field)
This function returns ACNET status values as follows:
OK success
CBS_INVARG invalid plane specified
CBS_NOSETUP an active window has not been established
This function requires the following include files:
cnsparam_h, cbslib_h, acnet_errors_h
Related functions:
wn_axis_grid(_c), wn_grid(_c), wn_quick_grid, wn_color(_c),
wn_user_defined_color_c, wn_read_user_defined_color,
wn_text_size(_c), wn_flush, wn_multitrace_axis_label_c,
wn_multitrace_grid_c, wn_multitrace_grid_pixel_c,
intro_graphics_windows
C/C++ usage:
static const char text[] = "Axis title";
int status;
int plane = WN_HORZ;
int num_major = 4;
int num_minor = 5;
int grid_it = TRUE;
int text_size = WN_TEXT_MIN_SIZE;
int text_color = CYAN;
int label_length = 6;
int label_type = CNV_FLOAT_EXP;
int squeeze_it = TRUE;
int invert_ticks = FALSE;
int grid_line_typ = WN_SOLID_LINE;
int label_color = GREEN;
unsigned int options = WN_OPT_NONE;
float *loc_major = (float *) NULL;
float *tick_length = (float *) NULL;
float *loc_minor = (float *) NULL;
status = wn_axis_label_c(plane,num_major,num_minor,grid_it,text,
text_size,text_color,label_length,
label_type,loc_major,squeeze_it,
tick_length,loc_minor,invert_ticks,
grid_line_typ,label_color,options);