subrect | R Documentation |
Draw shapes inside a rect
subrect(
xleft,
ybottom,
xright,
ytop,
type = c("diagonal", "square"),
pos = c("topleft", "topright", "bottomleft", "bottomright"),
...
)
xleft, ybottom, xright, ytop |
coordinates of the main |
type, pos |
the type (diagonal or square) and position of the shape
inside the |
... |
additional arguments passed to |
pos <- eval(formals(subrect)$pos)
par(mfrow = n2mfrow(length(pos)))
for (p in pos) {
plot(0, 0, main = p, type = 'n', xlab = '', ylab = '')
rect(-0.5, -0.5, 0.5, 0.5)
subrect(-0.5, -0.5, 0.5, 0.5, type = 'diag', pos = p, col = 'red')
}
for (p in pos) {
plot(0, 0, main = p, type = 'n', xlab = '', ylab = '')
rect(-0.5, -0.5, 0.5, 0.5)
subrect(-0.5, -0.5, 0.5, 0.5, type = 'square', pos = p, col = 'red')
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.