interactiveLayout: An interactive version of 'layout'

View source: R/interactiveLayout.R

interactiveLayoutR Documentation

An interactive version of layout

Description

layout2() provides an interactive version of graphics::layout(). Once called, an interactive grid is displayed and can be used to create a layout.

Usage

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

Arguments

n

Number of plot regions, default is set to 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 graphics::layout.show() is used to get a preview of the subplots regions.

now

logical. If TRUE graphics::layout() is called on exit.

Details

Arguments grain.x and grain.y control the aspect of the support grid generated to locate the different panels. Once the grid pops up, the user must click 2n times to select the size of the n subplots. A panel is delimited by two consecutive clicks, the tow cells selected by click 2p and clicks 2*p+1 will be used to compute the area allocated to 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 graphics::layout() is ultimately called, layout2() has the same limits, i.e. currently 200 for the numbers of rows and columns and 10007 for the total number of cells.

Value

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


KevCaz/graphicsutils documentation built on Sept. 16, 2022, 10:05 a.m.