add_marks: Add a marks look to a shape.

View source: R/add_look.R

add_marksR Documentation

Add a marks look to a shape.

Description

A mark is a polygon-based marker for a given x-y location. Not applicable for shapes of type 'refline'.

Usage

add_marks(
  pj,
  mark = "d",
  size = 1,
  fc = "white",
  fa = 0.5,
  lc = "black",
  la = 0.5,
  lw = 1,
  et = NA,
  ec = NA,
  ea = NA,
  shape = ".",
  name = "."
)

Arguments

pj

an object of class 'pj'.

mark

character vector of symbols to mark x-y coordinates. Each value must be a single character, where 'c' indicates a circle, 'd' indicates a diamond, 's' indicates a square, '3' through '9' indicate 3 through 9 pointed stars, '<' indicates a left-pointing triangle, '>' indicates a right-pointing triangle, 'v' indicates a down-pointing triangle, and '^' indicates an up-pointing triangle.

size

positive numeric vector indicating symbol size relative to the default (thus 1 indicates default sized, 1/2 indicates half sized, and 2 indicates double sized).

et

character vector indicating the type of enclosure with which to surround symbols in mark. Values of NA indicates no enclosure. Values of 'c', 'd' or 's' indicate an empty circle, diamond, or square, respectively. 'C', 'D' or 'S' indicate a solid circle, diamond, or square, respectively.

ec

NA or a character vector indicating the colors of (optional) mark enclosures.

ea

NA or a proportion vector (i.e., between 0 and 1 inclusive) indicating the alpha opacity of (optional) mark enclosure colors. 0 = fully transparent, 0.5 = translucent, and 1 = fully opaque.

shape

character scalar indicating the type of shape to which the look will be applied.

Value

pj with the addition of the mark look applied to the specified shape.

Valid combinations of argument properties

Marks can be validly described using the patterns of argument properties as follows, where base indicates that the argument set {mark, size} has been supplied, fill indicates that the argument set {fc, fa} has been supplied, line inidicates that the argument set {lc, la, lt, lw} have been supplied and enclosure indicates that the argument set {et, ec, ea} has been supplied.

base + line

Outlined mark.

base + fill

Solid mark.

base + line + fill

Outlined and filled mark

.

base + line + enclosure

Outlined mark in an enclosure

.

base + fill + enclosure

Solid mark in an enclosure

.

base + line + fill + enclosure

Outlined and filled mark in an enclosure

.

Argument recycling

The arguments mark, size, lc, la, lw, fc, fa, et, ec, and/or ea are recycled with the number of x-y pairs used to draw the shape to which the mark look is applied.

See Also

Other add_look: add_ci(), add_ends(), add_fills(), add_glyphs(), add_labels(), add_lines()


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