symmetric_limits | R Documentation |
Expand scale limits to make them symmetric around zero. Can be
passed as argument to parameter limits
of continuous scales from
packages 'ggplot2' or 'scales'. Can be also used to obtain an enclosing
symmetric range for numeric vectors.
symmetric_limits(x)
x |
numeric The automatic limits when used as argument to a scale's
|
A numeric vector of length two with the new limits, which are always such that the absolute value of upper and lower limits is the same.
symmetric_limits(c(-1, 1.8))
symmetric_limits(c(-10, 1.8))
symmetric_limits(-5:20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.