geom_violin_rast: This geom is similar to 'geom_violin', but creates a raster...

View source: R/geom-violin-rast.R

geom_violin_rastR Documentation

This geom is similar to geom_violin, but creates a raster layer

Description

This geom is similar to geom_violin, but creates a raster layer

Usage

geom_violin_rast(
  ...,
  raster.dpi = getOption("ggrastr.default.dpi", 300),
  dev = "cairo",
  scale = 1
)

Arguments

...

Other arguments passed on to layer(). These are often aesthetics, used to set an aesthetic to a fixed value, like colour = "red" or size = 3. They may also be parameters to the paired geom/stat.

raster.dpi

integer Resolution of the rastered image in dots per inch (default=300).

dev

string Specifies the device used, which can be one of: "cairo", "ragg" or "ragg_png" (default="cairo").

scale

numeric Scaling factor to modify the raster object size (default=1). The parameter 'scale=1' results in an object size that is unchanged, 'scale'>1 increase the size, and 'scale'<1 decreases the size. These parameters are passed to 'height' and 'width' of grid::grid.raster(). Please refer to 'rasterise()' and 'grid::grid.raster()' for more details.

Value

geom_violin_rast plot with rasterized layer

Aesthetics

geom_violin() understands the following aesthetics (required aesthetics are in bold):

  • x

  • y

  • alpha

  • colour

  • fill

  • group

  • linetype

  • linewidth

  • weight

Learn more about setting these aesthetics in vignette("ggplot2-specs").

Examples

library(ggplot2)
library(ggrastr)

ggplot(mpg) + geom_violin_rast(aes(x = factor(cyl), y = hwy), raster.dpi = 600)


ggrastr documentation built on June 7, 2023, 5:37 p.m.