Generate expansion vector for scales — expansion (original) (raw)
This is a convenience function for generating scale expansion vectors for the expand
argument of scale_(x|y)_continuousand scale_(x|y)_discrete. The expansion vectors are used to add some space between the data and the axes.
Usage
expansion(mult = 0, add = 0)
expand_scale(mult = 0, add = 0)
Arguments
vector of multiplicative range expansion factors. If length 1, both the lower and upper limits of the scale are expanded outwards by mult
. If length 2, the lower limit is expanded by mult[1]
and the upper limit by mult[2]
.
vector of additive range expansion constants. If length 1, both the lower and upper limits of the scale are expanded outwards by add
units. If length 2, the lower limit is expanded by add[1]
and the upper limit by add[2]
.