Skip to contents

Stacks together multiple plots

Usage

create_layerplot(
  plot.objects = NULL,
  filename = NULL,
  height = 10,
  width = 10,
  resolution = 1000,
  plot.objects.heights = rep(1, length(plot.objects)),
  main = "",
  main.x = 0.5,
  main.y = 0.5,
  x.spacing = 0,
  y.spacing = 0,
  xlab.label = "",
  xlab.cex = 2,
  ylab.label = "",
  ylab.label.right = "",
  ylab.cex = 2,
  main.cex = 3,
  legend = NULL,
  left.padding = 0,
  ylab.axis.padding = 0,
  xlab.axis.padding = 0,
  bottom.padding = 0,
  top.padding = 0,
  right.padding = 0,
  left.legend.padding = 2,
  right.legend.padding = 2,
  bottom.legend.padding = 2,
  top.legend.padding = 2,
  size.units = "in",
  enable.warnings = FALSE
)

Arguments

plot.objects

A list of plot objects. Goes in this order: Top Left, Top Right, Bottom Left, Bottom Right

filename

Filename to output to

height

Height of resulting file

width

Width of resulting file

resolution

Resolution of resulting file

plot.objects.heights

Heights of each row of the plot. Must be vector of same size as layout.height

main

main label text

main.x

main label x coordinate

main.y

main label y coordinate

x.spacing

horizontal spacing between each plot. Can be single value or vector of length layout.width - 1

y.spacing

vertical spacing between each plot. Can be single value or vector of length layout.height - 1

xlab.label

bottom x-axis main label

xlab.cex

bottom x-axis main label cex

ylab.label

left side y-axis label

ylab.label.right

right side y-axis label

ylab.cex

y-axis label cex

main.cex

main label cex

legend

legend for the plot

left.padding

padding from the left side of the frame

ylab.axis.padding

padding between axis and y label of plots. Can be single value or vector of length layout.width

xlab.axis.padding

padding between axis and x label of plots. Can be single value or vector of length layout.height

bottom.padding

padding from the bottom side of the frame

top.padding

padding from the top side of the frame

right.padding

padding from the right side of the frame

left.legend.padding

padding between legend and left side of figure (can use without a legend)

right.legend.padding

padding between legend and right side of figure (can use without a legend)

bottom.legend.padding

padding between legend and bottom side of figure (can use without a legend)

top.legend.padding

padding between legend and top side of figure (can use without a legend)

size.units

the units the height and width of file represent

enable.warnings

enables warnings to be output

Value

a Trellis object. For further details, see the 'Lattice' R package.

Examples

if (FALSE) {
x = rnorm(10000, mean = 100, sd = 50)
x = observations_to_histogram(round(x), histogram_bin_width = 5)
results = segment_and_fit(x, eps = 1)
cvg_plt = create_coverageplot(
  results
)
resid_plt = create_residualplot(
results
)

create_layerplot(
plot.objects = list(cvg_plt, resid_plt)
)
}