new_pj: Creates a new pj object

View source: R/new_pj.R

new_pjR Documentation

Creates a new pj object

Description

Set the minimum and maximum x and y values of a pj object background its fill color, line color, line width, and edge padding (where plotting does not occur).

Usage

new_pj(
  xmin,
  xmax,
  ymin,
  ymax,
  w = 6.5,
  h = 4.5,
  pad = 0.01,
  pu = "in",
  fc = "grey95",
  lc = "black",
  lw = 1
)

Arguments

xmin

numeric scalar giving the minimum x-value for plotting objects in the background region.

xmax

numeric scalar giving the maximum x-value for plotting objects in the background region.

ymin

numeric scalar giving the minimum y-value for plotting objects in the background region.

ymax

numeric scalar giving the maximum y-value for plotting objects in the background region.

w

positive numeric scalar giving the width of the background in inches, centimeters, or millimeters.

h

positive numeric scalar giving the height of the background in inches, centimeters, or millimeters.

pad

proportion vector of length 1, 2, or 4 (see details section) with value no larger than 0.25.

pu

character scalar defining units in which w and h are expressed. Valid values are 'in', 'cm', and 'mm' for inches, centimeters, and millimeters.

fc

character scalar fill color value.

lc

character scalar line color value.

lw

positive numeric scalar line width (default = 1).

Value

A pj object (a list of specific tibbles).

Edge padding

Edge padding can be achieved in three ways using the pad argument as shown in the following table:

edge pad = ppad = c(px, py) pad = c(pl, pr, pb, pt)
left p \* min(w, h)px \* wpl \* w
right p \* min(w, h)px \* wpr \* w
bottomp \* min(w, h)py \* hpb \* h
top p \* min(w, h)py \* hpt \* h

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