rects: Draw rectangles/ grids.

Description Usage Arguments Value Examples

Description

Draw rectangles/ grids.

Usage

1
2
3
rects(xl, yt, w = 1, h = 1, ncol = 3, nrow = 1,
  border = "transparent", add = FALSE, col = occblues, texts = NULL,
  texts.col = "auto", scale = FALSE, ...)

Arguments

xl

First/ left-most xleft.

yt

First/ top-most ytop.

w

Width of rectangles.

h

Height of rectangles.

ncol

Number of columns.

nrow

Number of rows. Default 1.

border

Default to transparent.

add

Default to FALSE.

col

Fill colours of rects.

texts

Text labels in the rectangles/ grid. Order is by column.

texts.col

Can be colours or one of the two keywords "auto" and "theme". "auto" would make black/ white texts based on the underlying rectangle colour. "theme" would choose the colours from the colours supplied to rectangles. Darkest one would be the black equivalent and lightest one the white equivalent. Works well on one- colour gradients.

scale

If TRUE, the fill colours of cells/ rectangles will be based on the values in the cell (need to be numeric). make.gradient can order the gradient key colours beforehand.

Value

Draw rectangles.

Examples

1
rects(0, 5, 1, 1, 5, 5, col = occblues, texts = 1:25)

monorunner/smcolors documentation built on May 23, 2019, 6:10 a.m.