Description Usage Arguments Value Author(s) Examples
This is useful for setting a margin in the plot region.
1 | extend_ranges(x, f = qpar("mar"))
|
x |
the data vector (either the orginal vector or its range) or an n by 2 matrix which is used to define the ranges of two axes in two columns |
f |
the amount to extend the range (usually a scalar; when it is a vector, its length must be 2 (giving the amount to extend to the left and right respectively) or 4 (extending x-axis and y-axis respectively) |
a vector or a matrix of ranges corresponding to the input x
Yihui Xie
1 2 3 4 5 6 7 8 9 | extend_ranges(c(0, 1))
extend_ranges(1:10)
m <- matrix(c(c(1, 5, 10), c(5, 7, 8)), ncol = 2)
extend_ranges(m)
# larger top and right margins
extend_ranges(m, f = c(0.1, 0.2))
# larger horiz margins, small vertical margins
extend_ranges(m, f = c(0.2, 0.2, 0.1, 0.1))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.