new_pvtri: Add one or more proportional-vertex based triangle shapes

View source: R/new_triangle.R

new_pvtriR Documentation

Add one or more proportional-vertex based triangle shapes

Description

Proportional-vertex based triangle shapes are created by proportionally defining vertex locations within a bounding rectangle. These shapes are located in plotting regions using bounding rectangles; a concept used in defining function parameters. See the locating bounding rectangles section for details.

Usage

new_pvtri(
  jp,
  x,
  y,
  pvx,
  pvy,
  w = NA,
  h = NA,
  px = 0.5,
  py = 0.5,
  x2 = NA,
  y2 = NA,
  look = NULL,
  mod = NULL,
  region = ".",
  name = "."
)

Arguments

pvx, pvy

(required) proportion vectors of length 3 indicating the proportional x and y locations of the three vertices of all triangles to be plotted. All values must be between 0 and 1, inclusive. See the the pvx and pvy arguments section.

Value

jp with the addition of the specified proportional-based triangle shape(s).

The pvx and pvy arguments

pvx indicates, as a proportion, how far across the bounding rectangle each of the three vertices of all triangles are located (from left to right). pvy indicates, as a proportion, how far up the bounding rectangle each of the three vertices of all triangles are located. For example:

pvx = c(0, 1/2, 1), pvy = c(0, 1, 0)

Produces an upward isosceles triangle.

pvx = c(0, 0, 1), pvy = c(0, 1, 0)

Produces a right triangle with the 90-degree angle located at the bottom left corner of the bounding rectangle.

pvx = c(0, 0, 1), pvy = c(0, 1, 1/2)

Produces a rightward isosceles triangle.

Argument recycling

Arguments x, y, px, py, w, h x2, and y2 are recycled.

See Also

Other new_shape: new_isosceles(), new_right()

Other new_triangle: new_isosceles(), new_right()


j-martineau/pj documentation built on March 19, 2022, 5:32 a.m.