Skip to contents

Create a scatterplot using variables in the object metadata and color cells by the density of points in the x-y space.

Usage

DensityScatter(
  object,
  x,
  y,
  log_x = FALSE,
  log_y = FALSE,
  quantiles = NULL,
  raster = NULL,
  raster.dpi = c(512, 512)
)

Arguments

object

A Seurat object

x

Name of metadata variable to plot on x axis

y

Name of metadata variable to plot on y axis

log_x

log10 transform x values

log_y

log10 transform y values

quantiles

Vector of quantiles to display for x and y data distribution. Must be integer values between 0 and 100. TRUE can be passed as a shorthand way to set c(5, 10, 90, 95). If FALSE or NULL, no quantile information is displayed

raster

Convert points to raster format. If NULL, points will automatically be rasterized if plotting more than 100,000 cells.

raster.dpi

Pixel resolution for rasterized plots.

Value

Returns a ggplot object