.ig >>
<STYLE TYPE="text/css">
<!--
        A:link{text-decoration:none}
        A:visited{text-decoration:none}
        A:active{text-decoration:none}
-->
</STYLE>
<title>ploticus: xautorange and yautorange attributes</title>
<body bgcolor=D0D0EE vlink=0000FF>
<br>
<br>
<center>
<table cellpadding=2 bgcolor=FFFFFF width=550 ><tr>
<td>
  <table cellpadding=2 width=550><tr>
  <td><br><h2>xautorange and yautorange attributes</h2></td>
  <td align=right>
  <small>
  <a href="../doc/Welcome.html"><img src="../doc/ploticus.gif" border=0></a><br>
  <a href="../doc/Welcome.html">Welcome</a> &nbsp; &nbsp;
  <a href="../gallery/index.html">Gallery</a> &nbsp; &nbsp;
  <a href="../doc/Contents.html">Handbook</a> 
  <td></tr></table>
</td></tr>
<td>
<br>
<br>
.>>

.TH xautorange_and_yautorange_attributes PL "17-SEP-2001   PL www.sgpr.net"

.SH USAGE
\fCxautorange:  datafield=\fIdfields\fC  \fIother subattributes..\fR
.br
or..
.br
\fCyautorange:  datafield=\fIdfields\fC  \fIother subattributes..\fR

.ig >>
<br><br><br>
.>>

.SH DESCRIPTION
\fBxautorange\fR and \fByautorange\fR are attributes of
.ig >>
<a href="areadef.html">
.>>
\0proc areadef
.ig >>
</a>
.>>
that allow the plot range to be determined by the range of data.
Because this attribute is fairly involved, it has a manual page of its own.
.LP
Default autorange behavior is as follows:
For numeric data the range is set to the nearest whole high and low scale increments 
that encompass the min and max of the data.
For date and time data the range is set to the exact min and max of the data.

.ig >>
<br><br><br>
.>>
.SH VARIABLES THAT ARE SET
.LP
\fBDATAXMIN\fR, \fBDATAXMAX\fR
.IP
The actual minima and maxima of the data field when ranging in X.  
Different from XMIN and XMAX in that these do not include any margin.
.LP
\fBDATAYMIN\fR, \fBDATAYMAX\fR
.IP
The actual minima and maxima of the data field when ranging in Y.  
Different from YMIN and YMAX in that these do not include any margin.


.ig >>
<br><br><br>
.>>
.SH SUBATTRIBUTES
.LP
\fCdatafield=\fIdfields\fR
.IP
The only subattribute that \fBmust\fR be specified is \fCdatafield=\fIdfields\fR,
and it must be given before any other subattribute.
The \fIdfields\fR will be scanned to automatically find minima 
and maxima, and the range (either x or y) will be set accordingly.
\fIdfields\fR may be a single 
.ig >>
<a href="attributetypes.html#dfield">
.>>
\0dfield
.ig >>
</a>
.>>
or a comma-delimited list of several dfields with no embedded space.
Unless \fCcombomode=\fR is given, all fields will be treated independently
when searching for a minima and maxima.
Invalid or non-existant dfields will be silently ignored, but there must be at
least one valid dfield.  
[Field list new in version 1.41; contributed by Paul Totten.]

.LP
\fCcombomode=stack | hilo\fR
.IP
If \fCstack\fR is specified, and multiple \fCdatafields\fR are given, 
the datafields will be summed before searching for minima and maxima.
This is useful when generating stacked bar graphs.
\fChilo\fR allows autoranging to work properly when superimposing error bars over another graph.
Usually 2 datafields are used, one of which is the error bar amount.

.LP
The following subattributes allow autorange behavior to be controlled explicitly:
.LP
\fCincmult=\fIh\fR 
.IP
controls the amount of margin at high and low end when 
working with numeric data in default mode as described above.  
The default \fIh\fR is 1.0.
The scale increment will be multiplied by \fIh\fR before determining the range.
The low end of the range will not dip below zero if data are all positive.  
Probably should not be used with any other 
subattributes except \fCdatafield=\fR.  New in version 1.40.
.LP
\fCnearest=\fIs\fR
.IP
may be used to explicitly define the extent of the range, 
to a boundary corresponding to a round value of your choice.  
If you do not specify a \fCnearest=\fR value autorange
will guess based on the magnitude of the data.
If \fCnearest=exact\fR is specified, the range will be the 
exact minima to the exact maxima.
See the table below for some possible values for \fIs\fR.
An example: if \fIs\fR is \fC100\fR, and the data range
from 23 to 1162, the plot's range will be 0 to 1200.
The following illustrates some possible values for \fCnearest=\fIs\fR:
.br
.nf
.ft C
s         range min and max will be set to:
-------   ---------------------------------
10        the nearest multiple of 10
0.1       the nearest multiple of 0.1
month     the nearest month boundary (date or datetime scaletypes only)
quarter   the nearest quarter-year boundary (date or datetime only)
year      the nearest year boundary (date or datetime only)
hour      the nearest hour boundary (time or datetime only)
day       the nearest day boundary (datetime only)
exact     the exact minima and maxima
(none)    a reasonable default (numeric data only)
.fi
.ft R
.LP
\fCmargin=\fIm\fR 
.IP
If specified, \fIm\fR basic units will be added to the
maxima and also subtracted from the minima, before considering \fCnearest\fR.  
This may be used to guarantee margins at each end of the range.
(Basic units are days for \fCdate\fR and \fCdatetime\fR scaletypes; and 
minutes for \fCtime\fR.)
.LP
\fClowfix=\fIlowval\fR 
.IP
If specified, the minima will always be \fIlowval\fR.
This is useful when you want only the maxima to be automatically set based on data.
(Introduced in version 1.3)
.LP
\fChifix=\fIhival\fR 
.IP
If specified, the maxima will always be \fIhival\fR.
This is useful when you want only the minima to be automatically set based on data.
(Introduced in version 1.3)
.LP
\fCformat=\fIprintfspec\fR 
.IP
For very small numbers this subattribute may be useful, since normally
values are rounded to six decimal places (introduced in version 1.34).
.LP
\fCselectrows=\fIconditional expression\fR
.IP
This allows a
.ig >>
<a href="condex.html">
.>>
\0conditional expression
.ig >>
</a>
.>>
to be applied in order to select data rows to be tested when
scanning for minima and maxima.
If used, this subattribute must be the last on the line, and 
will have embedded spaces, unlike the other subattributes.
New in 2.00.  See example below.


.LP
Example: \fCxautorange: datafield=2 nearest=month margin=31\fR
.LP
Example: \fCyautorange: datafield=3,4,5,6,7  selectrows=@sex = f\fR
.LP
Some gallery examples where \fCxautorange\fR is used:
.ig >>
<a href="../gallery/qual.htm">
.>>
qual
.ig >>
</a>
.>>
,
.ig >>
<a href="../gallery/hitcount.htm">
.>>
hitcount
.ig >>
</a>
.>>
, and
.ig >>
<a href="../gallery/milltest.htm">
.>>
milltest
.ig >>
</a>
.>>

.ig >>
<br>
<br>
</td></tr>
<td align=right>
<a href="Welcome.html">
<img src="../doc/ploticus.gif" border=0></a><br><small>data display engine &nbsp; <br>
<a href="../doc/Copyright.html">Copyright Steve Grubb</a>
<br>
<br>
<center>
<img src="../gallery/all.gif">
</center>
</td></tr>
</table>
.>>
