Accepts a ggplot object and converts it to a gtable before setting panel dimensions and returning (and showing) the modified gtable.

resize_and_show(
  x,
  size,
  width,
  height,
  unit = "in",
  orientation = c("landscape", "portrait"),
  aspect = 1.6,
  clip = TRUE
)

set_panel_dims(
  ggplot = NULL,
  ggplot_gtable = ggplotGrob(ggplot),
  height = width,
  width = height
)

set_plot_clipping(x, clip = TRUE)

show_newpage_grid(x)

get_panel_aspect_ratios(ggplot = NULL, ggplot_gtable = ggplotGrob(ggplot))

Arguments

x

grid object

size

Value of both width and height, if defined

height, width

For set_panel_dims: Dimensions in grid::unit()

unit

Character for units of width and height, passed to grid::unit()

orientation

Character either 'landscape'/'l' or 'portrait'/'p'

aspect

Numeric for aspect ratio to apply

clip

Should clipping be on or off? Set to TRUE or FALSE. Default is FALSE: turn clipping off.

ggplot

Input ggplot object

ggplot_gtable

Input gtable object

Value

Invisibly returns the grid object.

Functions

  • resize_and_show(): Display and resize a grid object on new page

  • set_panel_dims(): Alter dimensions of plot area

  • set_plot_clipping(): Turn clipping off for all grobs in a grid object

  • show_newpage_grid(): Display grid object on new page

  • get_panel_aspect_ratios(): Display grid object on new page

See also