view_grob: View Grob

Description Usage Arguments Details Examples

View source: R/view.R

Description

View an grob outputted by one of the grob_ functions with a given width and height.

Usage

1

Arguments

grob

An object outputted by one of the following functions:

  • grob_matrix

  • grob_image

  • grob_row

  • grob_col

  • grob_layout

height

The numeric height in millimeters the user wishes to view the grob in.

width

The numeric width in millimeters the user wishes to view the grob in.

Details

Plotted with gridExtra::grid.arrange().

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
df = data.frame(
  x = c(15, 4, 16, 11),
  y = c(10, 30, 3, 10)
  ) 
  
df %>%
  grob_matrix() %>%
  view_grob()
  
gg = ggplot2::ggplot(data = df, mapping = ggplot2::aes(x = x, y = y)) +
  ggplot2::geom_line(color = 'red')
  
gg %>%
  grob_image() %>%
  view_grob()

grobblR documentation built on Sept. 15, 2021, 1:07 a.m.