geom_beeswarm_rast: This geom is similar to 'geom_beeswarm', but creates a raster...

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

geom_beeswarm_rastR Documentation

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

Description

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

Usage

geom_beeswarm_rast(
  ...,
  priority = c("ascending", "descending", "density", "random", "none"),
  cex = 1,
  groupOnX = NULL,
  dodge.width = 0,
  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.

priority

string Method used to perform point layout (see ggbeeswarm::position_beeswarm).

cex

numeric Scaling for adjusting point spacing (see ggbeeswarm::position_beeswarm)

groupOnX

boolean Whether jitter be added to the x axis (default=NULL). if TRUE then jitter is added to the x axis and if FALSE jitter is added to the y axis. (The default NULL causes the function to guess which axis is the categorical axis based on the number of unique entries in each). Refer to see ggbeeswarm::position_beeswarm for more details.

dodge.width

numeric Amount by which points from different aesthetic groups will be dodged (default=0). This requires that one of the aesthetics is a factor. Refer to see ggbeeswarm::position_beeswarm for more details.

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_beeswarm plot with rasterized layer

Examples

library(ggplot2)
library(ggrastr)

ggplot(mtcars) + geom_beeswarm_rast(aes(x = factor(cyl), y = mpg), raster.dpi = 600, cex = 1.5)


VPetukhov/ggrastr documentation built on June 28, 2023, 10:25 a.m.