yyplot: yyplot

yydevR Documentation

yyplot

Description

Save ggplot object or create plot device.

Usage

yydev(
  filename = "Rplot%03d.tif",
  width = 12,
  height = 12,
  path,
  dpi = 300,
  verbose = TRUE,
  compression = "lzw",
  fix_text_size = FALSE,
  ...
)

yysave(
  plot = last_plot(),
  filename = "Rplot%03d.tif",
  width = 12,
  height = 12,
  path,
  dpi = 300,
  compression = "lzw",
  fix_text_size = FALSE,
  ...
)

Arguments

filename

File name to create on disk.

width, height

Plot size in cm. Defaults to the 8 x 6 cm.

path

Path of the directory to save plot to.

dpi

Plot resolution.

verbose

logical, whether to display prompts.

compression

tiff option, the type of compression to be used. c("none", "rle", "lzw", "jpeg", "zip", "lzw+p", "zip+p").

fix_text_size

svglite option, if TRUE each string will have the textLength CSS property set to the width calculated by systemfonts and lengthAdjust='spacingAndGlyphs'.

...

others values from svglite::svglite, grDevices::cairo_pdf, grDevices::tiff, grDevices::jpeg, grDevices::png.

plot

Plot to save, defaults to last plot displayed.

Examples

## Not run: 
## build device
yydev("tmp001.tif")
ggplot(mtcars, aes(mpg, wt)) +
    geom_point()
dev.off()

## Export the ggplot image directly.
ggplot(mtcars, aes(mpg, wt)) +
    geom_point()
yysave(filename = "tmp003.pdf")

## End(Not run)

yanpd01/yyeasy documentation built on Dec. 1, 2022, 10:58 p.m.