ploticus: xautorange and yautorange attributes

## xautorange and yautorange attributes | Welcome Gallery Handbook |
| Manual page for xautorange_and_yautorange_attributes(PL)

## USAGE

`xautorange: datafield=`dfields`` other subattributes..
or..``
`yautorange: datafield=`dfields`` other subattributes..

## DESCRIPTION

xautorange and yautorange are attributes of proc areadef 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.``

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.``

## VARIABLES THAT ARE SET

DATAXMIN, DATAXMAX

  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.``

DATAYMIN, DATAYMAX

  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.``

## EXAMPLES

A gallery example that determines both X and Y axes from the data is scatterplot10.`` Others are stockday and mouse

## SUBATTRIBUTES

`datafield=`dfields

  The only subattribute that must be specified is `datafield=`dfields, and it must be given before any other subattribute.`` The dfields will be scanned to automatically find minima and maxima, and the range (either x or y) will be set accordingly.`` dfields may be a single dfield or a comma-delimited list of several dfields with no embedded space.`` Unless `combomode=` 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 contributed by Paul Totten.]

`combomode=stack | hilo`

  If `stack` is specified, and multiple `datafields` are given, the datafields will be summed before searching for minima and maxima.`` This is useful when generating stacked bar graphs.`` `hilo` 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.``

The following subattributes allow autorange behavior to be controlled explicitly:

`incmult=`h

  controls the amount of margin at high and low end when working with numeric data in default mode as described above. The default h is 1.0.`` The scale increment will be multiplied by h 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 `datafield=`.

`nearest=`s

  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 `nearest=` value autorange will guess based on the magnitude of the data.`` If `nearest=exact` is specified, the range will be the exact minima to the exact maxima.`` See the table below for some possible values for s.`` An example: if s is `100`, and the data range from 23 to 1162, the plot's range will be 0 to 1200.`` The following illustrates some possible values for `nearest=`s:

      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)

  ``

`margin=`m

  If specified, m basic units will be added to the maxima and also subtracted from the minima, before considering `nearest`. This may be used to guarantee margins at each end of the range.`` (Basic units are days for `date` and `datetime` scaletypes; and minutes for `time`.)

`lowfix=`lowval

  If specified, the minima will always be lowval.`` This is useful when you want only the maxima to be automatically set based on data.``

`hifix=`hival

  If specified, the maxima will always be hival.`` This is useful when you want only the minima to be automatically set based on data.``

`format=`printfspec

  For very small numbers this subattribute may be useful, since normally values are rounded to six decimal places.``

`selectrows=`conditional expression

  This allows a conditional expression 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.``

Example: `xautorange: datafield=2 nearest=month margin=31`

Example: `yautorange: datafield=3,4,5,6,7 selectrows=@sex = f`

Some gallery examples where `xautorange` is used: qual , hitcount , and milltest
data display engine
Copyright Steve Grubb

Markup created by unroff 1.0, `` `` December 10, 2002.