#set TITLE = "proc axis (xaxis or yaxis)"
#include top

.ig >>
<center><img src="../gallery/sa0.gif"></center>
.>>

.SH DESCRIPTION
.LP
\fBproc xaxis \fR generates an X axis.
.br
\fBproc yaxis \fR generates a Y axis.
.LP
Both procs use the same attributes and operate in the same way.
.LP
A typical axis is a line with some number of regularly placed
marks called \fBtics\fR, each of which has a label called a \fBstub\fR
The axis also usually has a descriptive text \fBlabel\fR nearby.
.LP
Often axis attributes are specified within \fBproc areadef\fR
using \fCxaxis.\fR or \fCyaxis.\fR prefixes on the attribute names.  
This is usually more convenient, and allows the entire areadef with
axes specifications to be cloned for multiple plots on a page.
However, you might want to use separate \fBaxis\fR procs, for example, if
multiple axes per plot are needed, 

.SH FEATURES
\fBproc xaxis/yaxis\fR allows tics and stubs to be spaced
incrementally or at irregular points.  
A number of automatic stub formats are provided for dates, times, etc.
Axes may be placed anywhere, and grid lines or blocks may optionally be rendered.

.SH EXAMPLES
See the Gallery Scaling and Axes examples
.ig >>
<a href="../gallery/gall.sa.html"><img src="../gallery/btn/here.gif"></a>
.>>

.SH PREREQUISITES
A plotting area must be defined using \fBproc areadef\fR.
If stubs are to be taken from data fields, data must have already
been accessed or defined using \fBproc getdata\fR.

.SH MODES
Stubs may be automatically generated (incremental), 
specified within the script,
or taken from plot data fields, an external file, or defined categories.
Self-locating stubs (stubs that contain an embedded location) may be used.

.SH VARIABLES THAT ARE SET
XINC or YINC will be set to hold the axis increment value.


.SH MANDATORY ATTRIBUTES
None.  Default behavior is automatic incremental stubs 
and small outward tics at every unit.


.SH ATTRIBUTES
.LP
\fBlabel\fR 
.ig >>
<a href="attributetypes.html#text">
.>>
\fI text \fR
.ig >>
</a>
.>>
.IP
A text label that will be rendered near the axis, used to describe
what is being plotted.  
.br
Example: \fClabel: Yearly Income\fR

.LP
\fBtics\fR  \fCyes\fR | \fCnone\fR | 
.ig >>
<a href="linedetails.html">
.>>
\fI linedetails \fR
.ig >>
</a>
.>>
.IP
If anything other than \fCnone\fR is specified, tics will be rendered.
A linedetails specification may be given to control the color, etc. of tic marks.
Tics will be placed whereever a stub is placed.
Incremental tics may be rendered without stubs by setting \fCstubs: none\fR;
they can be controlled using \fCticincrement\fR.
.br
Example: \fCtics: yes\fR

.LP
The \fBstubs\fR attribute controls the contents of 
the stubs.  There are several mode variants described below:

.LP
\fBstubs  incremental [\fIh\fR] [\fIunits\fR]
.IP
Generate incremental stubs for numeric or date or time data.
A stub will be generated and placed at every \fIh\fR units.
\fIh\fR and \fIunits\fR may both be omitted for numeric data in which case a reasonable
default increment will be used (an \fIh\fR value of 0 has the same effect).
.br
Example: \fCstubs: incremental 10\fR  ..would place stubs at
every 10 units.
.br
\fIunits\fR allows flexibility with stub increments.
The following table illustrates some possibilities:
.ig >>
<a name=stubunits></a>
.>>
.nf
.ft C
scaletype  h units          result
---------  -------------    ------------
linear     1 1000           one stub every 1000, 
				stubs expressed in # of thousands
linear     1 0.01           one stub every 0.01, 
				stubs expressed in # of hundredths
date       1 		    one stub per day
datetime   1 		    one stub per day
date       1 month	    one stub per month
date       3 months	    one stub every three months
date	   1 year           one stub every year
time       20 minutes       one stub every 20 minutes
time       1 hour           one stub every hour
.ft R
.fi
See
.ig >>
<a href="scaleunits.html">
.>>
 scaleunits 
.ig >>
</a>
.>>
for more info on \fIunits\fR.

.LP
\fBstubs  text\fR  
.ig >>
<a href="attributetypes.html#text">
.>>
\fI multi-line text \fR
.ig >>
</a>
.>>
.IP
Indicates that the following lines of the script contain 
literal stub text, with one line per stub, and 
terminating with a blank line.
.br
Example:
.nf
.ft C
stubs:  text
	New York
	Atlanta
	Detroit
	Baltimore
	
.fi
.ft R

.LP
\fBstubs  list \fR
.ig >>
<a href="attributetypes.html#text">
.>>
\fI text  \fR
.ig >>
</a>
.>>
.IP
Same as \fCstubs  text\fR except that all stubs are given on one
line, with individual stubs separated by \fC\\n\fR.
.br
Example: \fCstubs: list New York\\nDetroit\\nBaltimore\fR

.LP
\fBstubs  file  \fIfilename\fR 
.IP
Same as \fCtext\fR except that content is to be 
taken from \fIfilename\fR.
.br
Example: \fCstubs: /home/myplots/stubs2\fR

.LP
\fBstubs  datafields=\fR
.ig >>
<a href="attributetypes.html#dfield">
.>>
\fIdfield1\fR
.ig >>
</a>
.>>
.ig >>
<a href="attributetypes.html#dfield">
.>>
,[\fIdfield2\fR] 
.ig >>
</a>
.>>
.IP
Stub content is to be taken from one or two data fields.
.br
Example: \fCstubs: datafields=1,2\fR  .. would use
the first and second data field for stubs.


.LP
\fBstubs  usecategories\fR 
.IP
If the scaletype for this axis is \fCcategories\fR, this
indicates that the defined category names should be
used as the stubs.  Implies self-locating.

.LP
\fBstubs  none\fR
.IP
Don't display any stubs.
Example: \fCstubs: none\fR


.LP
\fBselflocatingstubs\fR  (see \fCstubs\fR, above)
.IP
Same as \fCstubs\fR except that stubs are self-locating.  Each self-locating
stub contains a plottable value that determines where it will be placed.
.br
For the \fCtext\fR, \fClist\fR and \fCfile\fR modes, the first token 
(white-space delimited) in each stub is taken to be a plottable value.  
The remainder of the stub is displayed.
To display the placement value specify the value twice.
.br
For the \fCdatafields\fR mode, the first field \fIa\fR is used for placement
and the second field \fIb\fR is used for content.  To display the placement 
value, specify the same field# twice.
.br
Examples of selflocating stubs:
.br
stubs from datafields: 
.ig >>
<a href="../gallery/lineplot3.htm">
.>>
 lineplot3 
.ig >>
</a>
.>>

.LP
\fBstubrange\fR \fImin\fR [\fImax\fR]
.IP
Range (in 
.ig >>
<a href="attributetypes.html#positionunits">
.>>
 scaled units 
.ig >>
</a>
.>>
where tics and stubs should start
and stop along the axis.  Default range is the plot area minimus and maximus.
(If text stubs are being given, low end of range defaults to 
one unit in from the limit since this is usually what is desired 
for bar graphs, etc.)
If only one value is given it is taken to be the minimum.
Example: \fCstubrange: 5 95\fR


.LP
\fBstubformat\fR 
.ig >>
<a href="attributetypes.html#string">
.>>
\fI string \fR
.ig >>
</a>
.>>
.IP
Controls the format of numeric, date, or time stubs.  
.IP
For numeric stubs, \fIstring\fR is a 
.ig >>
<a href="attributetypes.html#printfspec">
.>>
 printf-spec 
.ig >>
</a>
.>>
Default is \fC%5.0f\fR.
.br
Example: \fCstubformat: %5.3f\fR 
.IP
For other scale types such as \fBdate\fR or \fBtime\fR,
a display format may be specified.
See 
.ig >>
<a href="scaleunits.html">
.>>
\fI scaleunits \fR
.ig >>
</a>
.>>
for supported display formats.  If \fCstubformat\fR is
not specified when date/time scaling is being done,
the current notation, or one similar to it, is used.

.LP
\fBstubevery\fR  \fIn\fR
.IP
When doing stubs from a data field or categories, this will
cause every \fIn\fRth stub (beginning with the first) to be displayed; the rest will not be 
displayed.  May be useful to avoid display of all categories as stubs 
and when categories represent a logical series.



.LP
\fBlocation\fR 
.ig >>
<a href="attributetypes.html#locvalue">
.>>
\fI locvalue \fR
.ig >>
</a>
.>>
.IP
Position of the axis line.  For an x axis this value is in 
y space; for a y axis this value is in x space.  Append \fC(s)\fR
to indicate scaled units.  
Tics and stubs will be placed relative to the position of the line.
This attribute is important when placing multiple axes or axes at
unusual locations.
.br
Example: \fClocation: 105(s)\fR


.LP
\fBaxisline\fR 
.ig >>
<a href="linedetails.html">
.>>
\fI linedetails \fR
.ig >>
</a>
.>>
.IP
Details pertaining to the axis line.  
Use \fCnone\fR to completely suppress the axis line.
.br
Example: \fCaxisline: width=1.2 color=green\fR

.LP
\fBaxislinerange\fR \fImin\fR [\fImax\fR]
.IP
May be used to control the range of the axis line.
If only one value is given it is taken to be the minimum.
.br
Example: \fCaxislinerange: 5 95\fR

.LP
\fBlabeldetails\fR 
.ig >>
<a href="textdetails.html">
.>>
\fI textdetails \fR
.ig >>
</a>
.>>
.IP
Details for rendering the label. Example: \fClabeldetails: size=13 style=I\fR

.LP
\fBlabeldistance\fR \fIn\fR
.IP
Distance of the label below / left of the axis line.
.ig >>
<a href="attributetypes.html#positionunits">
.>>
\fI Absolute units \fR
.ig >>
</a>
.>>
 .  This could also be done via \fClabeldetails: adjust=\fR.
.br
Example: \fClabeldistance: 0.6\fR


.LP
\fBstubdetails\fR 
.ig >>
<a href="textdetails.html">
.>>
\fI textdetails \fR
.ig >>
</a>
.>>
.IP
Details pertaining to stub text rendering.
.br
Example: \fCstubdetails: size=7\fR


.LP
\fBstubreverse\fR \fIyes|no\fR
.IP
If \fCyes\fR, reverses the placement of stubs so that the first stub is
placed at the maxima and the last at the minima, as is often desired
when placing text stubs along the Y axis.
If \fCno\fR, no stub reversal is done.
Default is for reversal to be done 
If text stubs are to be placed along the Y axis then the default is \fCyes\fR,
otherwise the default is \fCno\fR.
Example: \fCstubreverse: yes\fR


.LP
\fBsignreverse\fR \fIyes|no\fR
.IP
If \fCyes\fR, presents numeric stubs with sign reversed.
May be useful in creating an axis that moves from high values
to low values.  (Introduced in version 1.3).

.LP
\fBstubvert\fR \fIyes|no\fR
.IP
If \fCyes\fR, renders X axis stubs using vertical text.  This is useful if
X axis stubs are too long to fit horizontally.
Example: \fCstubvert: yes\fR


.LP
\fBstubslide\fR  
.ig >>
<a href="attributetypes.html#lenvalue">
.>>
\fI lenvalue \fR
.ig >>
</a>
.>>
.IP
If specified, axis stubs are shifted by the given amount.
For example, a positive value would shift X axis stubs to the right.
For example, a negative value would shift Y axis stubs downward.
Tics are not shifted.
.br
Example: \fCstubslide: 0.5\fR
.br
For another example see 
.ig >>
<a href="../gallery/axis9b.htm">
.>>
axis9b 
.ig >>
</a>
.>>

.LP
\fBticslide\fR  
.ig >>
<a href="attributetypes.html#lenvalue">
.>>
\fI lenvalue \fR
.ig >>
</a>
.>>
.IP
If specified, axis tics are shifted by the given amount.
For example, a positive value would shift X axis stubs to the right.
For example, a negative value would shift Y axis stubs downward.


.LP
\fBstubomit\fR \fIlist\fR
.IP
Used to supress certain indiviual stubs.  
This may be useful when stubs are given with data and certain ones
are too close together or should be omitted for some other reason.
For a more automatic stub supression, such as for log axes, see \fCstubcull\fR.
\fIlist\fR is a 
space-delimited list of one or more strings.  Each may include wild card
characters * and ?.  Any stubs matching any members of the list are suppressed
(however the tic is not suppressed).
.br
Example: \fCstubomit: 0.5 3.5\fR
.br
Another example that uses stubomit: 
.ig >>
<a href="../gallery/lineplot3.htm">
.>>
 lineplot3 
.ig >>
</a>
.>>

.LP
\fBstubcull\fR  \fCyes\fR | \fIh\fR
.IP
If specified, stubs are suppressed when too close to the adjacent stub.
This is useful with log axes to prevent "piling up" of stubs in the upper values.
If \fCyes\fR, a default minimum separation distance (0.1 inches) is used; you can also
specify a minimum separation distance \fIh\fR if desired.  New in version 1.40. 


.LP
\fBticlen\fR \fIlen1\fR [\fIlen2\fR]
.IP
Length of tics in 
.ig >>
<a href="attributetypes.html#positionunits">
.>>
 absolute units 
.ig >>
</a>
.>>
 . 
\fIlen1\fR is the distance that
tics will be drawn from the axis line leftward / downward
and \fIlen2\fR (optional) is the distance that
tics will be drawn from the axis line rightward / upward.
The default is for tics to be drawn a short distance leftward / downward.
Example: \fCticlen: 0.1 0.05\fR
.br
Example: \fCticlen: 0 0.05\fR

.LP
\fBticincrement\fR \fIn\fR [\fIunits\fR]
.IP
When no stubs are being rendered, this attribute may be used to
control tic placement.  Tics will be placed at every \fIn\fR units.
The \fIunits\fR modifier may be used when working with date or
time scaling; it may be \fCdays\fR, \fChours\fR, etc. 
(see
.ig >>
<a href="scaleunits.html">
.>>
scaleunits
.ig >>
</a>
.>>
).

.LP
\fBminortics\fR 
.ig >>
<a href="linedetails.html">
.>>
\fI linedetails \fR
.ig >>
</a>
.>>
.IP
Details pertaining to the minor tic marks.
Default is \fCnone\fR which suppresses minor tic marks.
Use \fCyes\fR to activate minor tics using the default detail
specifications.

.LP
\fBminorticinc\fR \fIn\fR [\fIunits\fR]
.IP
Minor tics to be drawn every \fIn\fR scaled units along the axis line.
The \fIunits\fR modifier may be used when working in date or time units;
it may be \fCdays\fR, \fChours\fR, etc.
(see
.ig >>
<a href="scaleunits.html">
.>>
scaleunits
.ig >>
</a>
.>>
).

.LP
\fBminorticlen\fR \fIlen1\fR [\fIlen2\fR]
.IP
Length of tics in 
.ig >>
<a href="attributetypes.html#positionunits">
.>>
 absolute units 
.ig >>
</a>
.>>
 . 
\fIlen1\fR is the distance that
minor tics will be drawn from the axis line leftward/downward,
and \fIlen2\fR (optional) is the distance that
tics will be drawn from the axis line rightward/upward.

.LP
\fBgrid\fR 
.ig >>
<a href="linedetails.html">
.>>
\fI linedetails \fR
.ig >>
</a>
.>>
| none
.IP
If specified, causes background grid lines to be drawn at stub or tic locations.
If no stubs or tics are being rendered, the \fCticincrement\fR attribute
may still be used to control placement of grid lines.
Extent of the lines may be controlled using \fCgridlineextent\fR.
Shaded blocks rather than lines may be done using \fCgridblocks\fR.
Default is "none".
.br
Example: \fCgrid: color=yellow width=1\fR

.LP
\fBgridblocks\fR
.ig >>
<a href="color.html">
.>>
\fI color1  color2\fR
.ig >>
</a>
.>>
 | none
.IP
If specified, causes a background grid made up of shaded blocks.
Blocks are shaded alternately using \fIcolor1\fR and \fIcolor2\fR.
Extent of the blocks may be controlled using \fCgridlineextent\fR.
New in version 1.40.
.br
Example: \fCgridblocks:  gray(0.9) white

.LP
\fBgridlineextent\fR 
.ig >>
<a href="attributetypes.html#locvalue">
.>>
\fI minlocval  maxlocval \fR
.ig >>
</a>
.>>
.IP
Allows explicit specification of where grid lines or shaded blocks begin
and end.  
Normally grid lines or blocks are drawn from the minima to the maxima.
For example if grid lines are being rendered along with a Y axis,
this attribute may be used to control where the lines begin and end in X.
Commonly used to extend grid structure into axis stubs area as an eye guide.
New in version 1.40.
.br
Example: \fCgridlineextent: min-1.5  max\fR

.LP
\fBgridskip\fR  \fCmin\fR | \fCmax\fR | \fCminmax\fR
.IP
Grid lines can sometimes interfere with a perpendicular axis 
line rendered earlier.  Use this option to suppress the 
grid at the minima, maxima, or both.

.LP
\fBautoyears\fR  \fCyy\fR  |  \fC'yy\fR  |  \fCyyyy\fR
.IP
This attribute may be used when doing incremental stubs
by month, in order to add the year below the first month and then
every January thereafter.  It will be located just below the months.
\fCyy\fR gives a two-digit year such as \fC99\fR;
\fC'yy\fR gives a two-digit year such as \fC'99\fR;
\fCyyyy\fR gives a four-digit year.

#include bottom
