Skip to contents

gg_dens Scatter plots with 2D density as color and alpha scale to beter visualise very dens data.

Usage

gg_dens(
  IC,
  x,
  y,
  xlab = ggplot2::waiver(),
  ylab = ggplot2::waiver(),
  ttl = "",
  gr = NULL,
  downsample = 1,
  x_lim = NULL,
  y_lim = NULL,
  unit = "dim",
  sds = 22,
  geom = "point",
  facet_sc = "fixed",
  labels = "standard",
  flag = NULL,
  save = FALSE
)

Arguments

IC

Ion count data.

x

Variable for the x axis.

y

Variable for the y axis.

xlab

Character string or expression for x axis label.

ylab

Character string or expression for x axis label.

ttl

Character string or expression for plot title.

gr

A grouping variable.

downsample

A numeric supplying the fraction for down-sampling of the original data frame.

x_lim

Numeric range for x axis (default = NULL).

y_lim

Numeric range for y axis (default = NULL).

unit

A character string for the units of the grouping variable. The string "um" is used for the grid cell size comparison plots. The string "dim" is used for all other plots, and defaults to the grouping variable name.

sds

Numeric settings the seeds for down-sampling via `set.seed()`.

geom

A character string for the geometry mapped on the aesthetics. Options are "point" for normal scatter plots, and "dens2d" for density contour lines.

facet_sc

The scales parameter of `ggplot2::facet_grid`

labels

Either "scientific" or "standard".

flag

A variable representing a flag for outliers.

save

Boolean whether to save the plot as an png.

Value

ggplot2::ggplot.