A function that generates a base figure, with optional guidelines, for a diagram.

create_base_figure(
  default = NULL,
  w = 6,
  h = 6,
  orientation = "landscape",
  margin = rep(0.25, 4),
  guidelines = TRUE,
  guide_major = seq(0.1, 0.9, 0.1),
  guide_minor = seq(0.05, 0.95, 0.1),
  guide_adjust = 1.25,
  new = FALSE
)

Arguments

default

Pre-packaged figure sizes, including...

  • 'US letter' or '8.5 x 11' (inches);

  • '3.54 x 3.54' (inches);

  • '5 x 5' (inches);

  • '7.25 x 5' (inches).

w

Width (in inches) for the x-axis.

h

Height (in inches) for the y-axis.

orientation

For default specifications, indicates whether figures should be in landscape or portrait style.

margin

A vector with the margins (in inches) for the bottom, left, top, and right, respectively.

guidelines

Logical; if TRUE, includes guidelines when generating the figure.

guide_major

Vector giving the major guideline positions (values must be between 0 and 1).

guide_minor

Vector giving the minor guideline positions (values must be between 0 and 1). If NULL, no minor guidelines are included.

guide_adjust

An adjustment controlling the position on the axes for the guideline numbers.

new

Logical; if TRUE a new plotting window is generated.

Examples

# Default (6 x 6 inches)
create_base_figure()


# No guidelines
create_base_figure( guidelines = FALSE )


# US letter size
create_base_figure( default = 'US letter' )


# US letter (Portrait)
create_base_figure( default = 'US letter', orientation = 'portrait' )