# pretty

0th

Percentile

##### Pretty Breakpoints

Compute a sequence of about n+1 equally spaced ‘round’ values which cover the range of the values in x. The values are chosen so that they are 1, 2 or 5 times a power of 10.

Keywords
dplot
##### Usage
pretty(x, ...)
"pretty"(x, n = 5, min.n = n %/% 3, shrink.sml = 0.75, high.u.bias = 1.5, u5.bias = .5 + 1.5*high.u.bias, eps.correct = 0, ...)
##### Arguments
x
an object coercible to numeric by as.numeric.
n
integer giving the desired number of intervals. Non-integer values are rounded down.
min.n
nonnegative integer giving the minimal number of intervals. If min.n == 0, pretty(.) may return a single value.
shrink.sml
positive numeric by a which a default scale is shrunk in the case when range(x) is very small (usually 0).
high.u.bias
non-negative numeric, typically $> 1$. The interval unit is determined as {1,2,5,10} times b, a power of 10. Larger high.u.bias values favor larger units.
u5.bias
non-negative numeric multiplier favoring factor 5 over 2. Default and ‘optimal’: u5.bias = .5 + 1.5*high.u.bias.
eps.correct
integer code, one of {0,1,2}. If non-0, an epsilon correction is made at the boundaries such that the result boundaries will be outside range(x); in the small case, the correction is only done if eps.correct >= 2.
...
further arguments for methods.
##### Details

pretty ignores non-finite values in x.

Let d <- max(x) - min(x) $\ge 0$. If d is not (very close) to 0, we let c <- d/n, otherwise more or less c <- max(abs(range(x)))*shrink.sml / min.n. Then, the 10 base b is $10^(floor(log10(c)))$ such that $b \le c < 10b$.

Now determine the basic unit $u$ as one of ${1,2,5,10} b$, depending on $c/b in [1,10$ and the two ‘bias’ coefficients, $h =$high.u.bias and $f =$u5.bias.

.........

##### References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.