view_grob: View Grob

View source: R/view.R

view_grobR Documentation

View Grob

Description

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

Usage

view_grob(grob, height = NA_real_, width = NA_real_)

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


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()


calvinmfloyd/grobblR documentation built on Aug. 30, 2024, 8:22 p.m.