geom_scattermost {scattermore} | R Documentation |
geom_scattermost
Description
Totally non-ggplotish version of geom_scattermore()
, but faster. It avoids
most of the ggplot processing by bypassing the largest portion of data
around any ggplot functionality, leaving only enough data to set up axes and
limits correctly. If you need to break speed records, use this.
Usage
geom_scattermost(
xy,
color = "black",
interpolate = FALSE,
pointsize = 0,
pixels = c(512, 512)
)
Arguments
xy |
2-column object with data, as in |
color |
Color vector (or a single color). |
interpolate |
Default FALSE, passed to |
pointsize |
Radius of rasterized point. Use |
pixels |
Vector with X and Y resolution of the raster, default |
Examples
library(ggplot2)
library(scattermore)
d <- data.frame(x = rnorm(1000000), y = rnorm(1000000))
x_rng <- range(d$x)
ggplot() +
geom_scattermost(cbind(d$x, d$y),
color = heat.colors(100, alpha = .01)
[1 + 99 * (d$x - x_rng[1]) / diff(x_rng)],
pointsize = 2.5,
pixels = c(1000, 1000),
interpolate = TRUE
)
[Package scattermore version 1.2 Index]