ggpreview: This function allows you to see plots inline, especially...

View source: R/ggpreview.R

ggpreviewR Documentation

This function allows you to see plots inline, especially useful when trying to format font sizes.

Description

Saves the plot in a tmp location and loads it as an image.

Usage

ggpreview(x, w = 5, h = 5, dpi = 150, units = "in")

Arguments

x

plot to visualize

w

width in inches

h

height in inches

dpi

resolution

units

character string specifying the units of the dimensions. By default in, inches, but it can also be px, cm, or mm.

Value

Show plot image in Viewer pane

Examples

## Not run: 
library(ggplot2)
df <- data.frame(x = 1:10, y = 1:10)
tmp_plt <- ggplot2::ggplot(df, ggplot2::aes(x = x, y = y)) +
ggplot2::geom_point()
ggpreview(x = tmp_plt, w = 9, h = 4, units = "in")

## End(Not run)

Single-Cell-Genomics-Group-CNAG-CRG/SCrafty-package documentation built on Aug. 20, 2022, 9:29 a.m.