powered by
A simple utility to generate a row or column of boxes (rectangles) for use in point-and-click panels.
layout.boxes(B, n, horizontal = FALSE, aspect = 0.5, usefrac = 0.9)
A list of rectangles.
Bounding rectangle for the boxes. An object of class "owin".
"owin"
Integer. The number of boxes.
Logical. If TRUE, arrange the boxes in a horizontal row. If FALSE (the default), arrange them in a vertical column.
TRUE
FALSE
Aspect ratio (height/width) of each box.
Number between 0 and 1. The fraction of height or width of B that should be occupied by boxes.
B
Adrian Baddeley Adrian.Baddeley@curtin.edu.au
and Rolf Turner rolfturner@posteo.net
This simple utility generates a list of boxes (rectangles) inside the bounding box B arranged in a regular row or column. It is useful for generating the positions of the panel buttons in the function simplepanel.
simplepanel
B <- owin(c(0,10),c(0,1)) boxes <- layout.boxes(B, 5, horizontal=TRUE) plot(B, main="", col="blue") niets <- lapply(boxes, plot, add=TRUE, col="grey")
Run the code above in your browser using DataLab