make_square: Plotting a square

Description Usage Arguments Author(s) Examples

View source: R/graph.R

Description

Plotting a square

Usage

1
2
make_square(center = c(0, 0), side = 2, col = "darkblue",
  fill = NULL, lty = 1)

Arguments

center

A vector of dimension 2 used to denote the center of the square (default: center = c(0,0)).

side

A numeric (positive) value used to indicate the length of one side of the square (default: side = 2).

col

A numeric or string used to denote the color of the border of the square (default: col = "darkblue")

fill

A numeric or string used to denote the number the color for filling the square The default, NULL, is to leave circle unfilled.

lty

A numeric value used the denote the line type used for the border of the square (default: lty = 1). See ?par for more details.

Author(s)

Stephane Guerrier

Examples

1
2
3
4
5
6
7
8
9
cols = hcl(h = seq(15, 375, length = 4), l = 65, c = 100)[1:3]
cols_trans = hcl(h = seq(15, 375, length = 4), l = 65, c = 100, alpha = 0.15)[1:3]
plot(NA, xlim = c(-110, 110), ylim = c(-110, 110), xlab = "x", ylab = "y")
grid()
make_square(center = c(-50,50), side = 100, col = cols[1], lty = 4)
make_square(center = c(0,0), side = 100, col = cols[2], fill = cols_trans[2], lty = 2)
make_square(center = c(50,-50), side = 100, col = cols_trans[3], fill = cols_trans[3])
make_square(center = c(50,-50), side = 100, col = cols[1], fill = cols_trans[3])
make_square(center = c(0,0), side = 150, col = cols_trans[1], fill = cols_trans[1])

SMAC-Group/ptdspkg documentation built on Oct. 30, 2019, 11:08 p.m.