ggsave_twitter: Save plot for Twitter

View source: R/ggsave.R

ggsave_twitterR Documentation

Save plot for Twitter

Description

Save at the right dimensions at 300 dpi

Usage

ggsave_twitter(
  filename,
  plot = ggplot2::last_plot(),
  device = ragg::agg_png,
  path = NULL,
  scale = 3,
  width = 1200,
  height = 675,
  units = "px",
  dpi = 300,
  limitsize = FALSE,
  bg = "white",
  ...
)

Arguments

filename

File name to create on disk.

plot

Plot to save, defaults to last plot displayed.

device

Device to use. Can either be a device function (e.g. png), or one of "eps", "ps", "tex" (pictex), "pdf", "jpeg", "tiff", "png", "bmp", "svg" or "wmf" (windows only). If NULL (default), the device is guessed based on the filename extension.

path

Path of the directory to save plot to: path and filename are combined to create the fully qualified file name. Defaults to the working directory.

scale

Multiplicative scaling factor.

width, height

Plot size in units expressed by the units argument. If not supplied, uses the size of the current graphics device.

units

One of the following units in which the width and height arguments are expressed: "in", "cm", "mm" or "px".

dpi

Plot resolution. Also accepts a string input: "retina" (320), "print" (300), or "screen" (72). Applies only to raster output types.

limitsize

When TRUE (the default), ggsave() will not save images larger than 50x50 inches, to prevent the common error of specifying dimensions in pixels.

bg

Background colour. If NULL, uses the plot.background fill value from the plot theme.

...

Other arguments passed on to the graphics device function, as specified by device.

Value

filename, quietly


petrbouchal/ptrr documentation built on Oct. 10, 2024, 7:21 a.m.