new_points: Add a points shape to a plot

View source: R/new_simples.R

new_pointsR Documentation

Add a points shape to a plot

Description

A points shape is one or more x-y pairs.

Usage

new_points(
  pj,
  x,
  y,
  order = "x",
  region = ".",
  look = NULL,
  mod = NULL,
  name = "."
)

Arguments

pj

an object of class 'pj'.

x

numeric vector defining the horizontal location of each point.

y

numeric vector defining the vertical location of each point.

order

character scalar 'x', 'y', or 'i' indicating, respectively, ordering x-y pairs on the value of x, ordering x-y pairs on the value of y, and identity (leaving the order of x-y pairs unchanged).

region

either character scalar "." to indicate the most recently used region, a positive integer to indicate the ID number of a region (0 indicates the background region), or a character scalar to indicate the name of a region ('bg' indicates the background region).

look

an optional list containing up to four lists specifying looks to apply to the shape. See the using look to make shapes appear section.

mod

an optional list containing up to four lists specifying modifications to apply to the shape. See the using mod to transform shapes section.

name

character scalar indicating a name for the shape. The special value "." indicates that the pj package create a default name for the shape.

Value

pj with the addition of the specified point shape.

Using look to make shapes appear

By itself, this function simply defines the location of x-y pairs in the assigned region for the specified shape. Various looks can be added to the shape using the look parameter or via the add_ci, add_glyphs, add_labels, and add_marks functions. Sub-lists of the look argument must be named 'ci', 'glyph', 'label', and/or 'mark' to indicate that a confidence interval, glyphs (single characters), labels, and/or point marks be added to the shape.

Argument recycling

The argument set {x, y, order} is recycled.

Using mod to transform shapes

Shapes can be transformed in four ways: dilation, reflection, rotation, and translation/. using the mod argument or the mod_dilate, mod_reflect, mod_rotate, and mod_translate. Sub-lists of the mod argument must be named 'dilate', 'reflect', 'rotate', and/or 'translate' to indicate that a dilation, reflection, rotation, and or translation be applied to the shape.

See Also

Other new_simples: new_reflines(), new_segments()


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