grid_stim: Make stimulus grid

Description Usage Arguments Value Examples

View source: R/grid_stim.R

Description

Show all your stimuli in a grid.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
grid_stim(
  stimuli,
  nrow = NULL,
  ncol = NULL,
  byrow = TRUE,
  padding = 10,
  fill = webmorph_options("fill"),
  maxwidth = 2000,
  maxheight = 2000
)

Arguments

stimuli

list of class stimlist

nrow

number of rows

ncol

number of columns

byrow

fill grid by rows (first ncol images in the first row); if FALSE, fills by columns (first nrow images in the first column)

padding

around each image in pixels

fill

background color

maxwidth, maxheight

maximum width and height of grid in pixels

Value

stimlist with grid image (no templates)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
stimuli <- demo_stim("composite")
grid <- grid_stim(stimuli, nrow = 2)
plot(grid)

# display by column
grid2 <- grid_stim(stimuli, ncol = 2, byrow = FALSE)
plot(grid2)

# images with different aspect ratios
demo_stim("rainbow") %>% grid_stim(ncol = 4) %>% plot()

facelab/webmorph documentation built on April 11, 2021, 6:34 a.m.