This function provides an interactive version of the layout function. Once layout2 is called, the users get a grid he can click on (thanks to locator function). Once the clicks have been achieved, the users can get the matrix created and/or use directly layout and then call the function.

interactiveLayout(
  n = 1,
  grain.x = 20,
  grain.y = grain.x,
  show = TRUE,
  now = TRUE
)

Arguments

n

Number of plot regions desired, default is 1.

grain.x

Number of vertical lines drawn to select the size of the subplots regions.

grain.y

Number of horizontal lines drawn to select the size of the subplots regions.

show

logical. If TRUE layout.show is used to get a preview of the subplots regions.

now

logical. If TRUE layout is called at layout2 exit.

Value

the matrix use to draw the layout is returned as an invisible output.

Details

Arguments grain.x and grain.y control the aspect of the support grid generated to locate the different panels. Once the grid popup, the user must click 2n times to select the size of their n subplot. A panel is delimited by two consecutive clicks: click 2p and clicks 2*p+1. The two cells the user clicked on will then be used to compute the area allocated for panel p. Note that the user is allowed to use the same area for several plots but only this area will actually be used only by the last one.

As layout is ultimately called, layout2 has the same limits: currently 200 for the numbers of rows and columns and 10007 for the total number of cells.