Skip to contents

Create a new ggplot.

Usage

# S3 method for flowSet
ggplot(
  data = NULL,
  mapping = ggplot2::aes(),
  ...,
  environment = parent.frame()
)

Arguments

data

Default dataset to use for plot in the form of a flowSet. If not specified, must be supplied in each layer added to the plot. Note that any metadata stored in pData will be merged into the underlying flowCore-tibble abstraction and will thus be available for plotting.

mapping

Default list of aesthetic mappings to use for plot. If not specified, must be supplied in each layer added to the plot. Note that variable names used for aesthetic mappings come from the featureNames of the input flowSet's constituent flowFrames.

...

Other arguments passed on to methods. Not currently used.

environment

Deprecated. Used prior to tidy evaluation.

Value

A ggplot

Examples

simulations <- simulate_cytometry_data()
test_flowset <- simulations$flowset

flowset_plot <-
  test_flowset |>
  ggplot2::ggplot(ggplot2::aes(x = feature_1, y = feature_2)) +
  ggplot2::geom_point()

flowset_plot_with_metadata <-
  test_flowset |>
  # note that `patient` below comes from the flowSet's metadata (pData)
  ggplot2::ggplot(ggplot2::aes(x = feature_1, y = feature_2, color = patient)) +
  ggplot2::geom_point()