plot_scatter: Scatter graph

View source: R/graphics_plot_scatter.R

plot_scatterR Documentation

Scatter graph

Description

Scatter plot from a long data.frame with columns named x, value, and variable.

Usage

plot_scatter(data, label_x = "", label_y = "", colors = NULL)

Arguments

data

long data.frame with columns x, value, variable

label_x

x‑axis label

label_y

y‑axis label

colors

optional color(s); for numeric variable, supply a gradient as c(low, high)

Details

Colors are mapped to variable. If variable is numeric, a gradient color scale is used when colors is provided.

Value

return a ggplot2::ggplot graphic

Examples

grf <- plot_scatter(iris |> dplyr::select(x = Sepal.Length,
value = Sepal.Width, variable = Species),
label_x = "Sepal.Length", label_y = "Sepal.Width",
colors=c("red", "green", "blue"))
plot(grf)

daltoolbox documentation built on Feb. 10, 2026, 9:06 a.m.