Skip to contents

Fix the width/height of panels in a single plot object.

Usage

panel_fix_single(
  x,
  panel_index = NULL,
  respect = NULL,
  width = NULL,
  height = NULL,
  margin = 1,
  units = "in",
  raster = FALSE,
  dpi = 300,
  BPPARAM = BiocParallel::SerialParam(),
  return_grob = FALSE,
  bg_color = "white",
  save = NULL,
  verbose = TRUE
)

Arguments

x

A ggplot object, a grob object, or a combined plot made by patchwork or cowplot package.

panel_index

Specify the panel to be fixed. If NULL, will fix all panels.

respect

If a logical, this indicates whether row heights and column widths should respect each other.

width

The width of the panel.

height

The height of the panel.

margin

Margins around the plot.

units

The units in which height, width and margin are given. Can be mm, cm, in, etc. See unit.

raster

Whether to rasterize the panel.

dpi

Plot resolution.

BPPARAM

An BiocParallelParam instance determining the parallel back-end to be used during building the object made by patchwork package.

return_grob

If TRUE then return a grob object instead of a wrapped patchwork object.

bg_color

Plot background color.

save

NULL or the file name used to save the plot.

verbose

Whether to print messages.