add_glyphs: Add a glyphs look to a shape.

View source: R/add_look.R

add_glyphsR Documentation

Add a glyphs look to a shape.

Description

A glyph is a single character. A glyphs look is a glyph marker for each specific x-y location of a shape. Not applicable for shapes of type 'refline'.

Usage

add_glyphs(
  pj,
  glyph = ".",
  size = 10,
  gc = "black",
  ga = 0.5,
  et = NA,
  ec = NA,
  ea = NA,
  shape = ".",
  name = "."
)

Arguments

pj

an object of class 'pj'.

glyph

character vector of glyphs to mark x-y coordinates. Each glyph must be a single character (which is interpreted literally). The only exception is when mark = ".", in which case, a small dot is plotted.

size

positive numeric vector giving glyph text size in points.

gc

NA or a character vector indicating the glyph text color.

ga

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

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 glyph look applied to the specified shape.

Valid combinations of argument properties

Glyphs can be validly described using two patterns of argument properties as follows, where base indicates that the argument set {mark, size, lc, la} have all been supplied and enclosure indicates that the argument set {et, ec, ea} have all been supplied.

base

The glyph in mark is printed without any enclosure

.

base + enclosure

The glyph in mark is printed within an enclosure

.

Argument recycling

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

See Also

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


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