Create a scatter plot to display the relationship between two continuous variables.
This is essentially a wrapper for ggplot2::geom_point()
.
Usage
plot_scatter(
data,
x,
y,
color_by,
smooth = FALSE,
range = c(0.01, 0.99),
title = "",
aspect_ratio = 1
)
Arguments
- data
A data frame.
- x
.
- y
.
- color_by
Column metadata field(s) or feature(s) to color by.
- smooth
A logical scalar. Smooth values. Helps to visualize expression patterns in a plot with many overlapping points.
- range
A vector of 2 values indicating the minimum and maximum percentiles for the color range. Helps to visualize expression patterns when extreme outliers are present. For example,
c(0, 0.99)
will not expand the color scale above 99th percentile.- title
Plot title.
- aspect_ratio
Aspect ratio of the panel.