| plot_scatter | R Documentation |
Scatter plot from a long data.frame with columns named x, value, and variable.
plot_scatter(data, label_x = "", label_y = "", colors = NULL)
data |
long data.frame with columns |
label_x |
x‑axis label |
label_y |
y‑axis label |
colors |
optional color(s); for numeric |
Colors are mapped to variable. If variable is numeric, a gradient color scale is used when colors is provided.
return a ggplot2::ggplot graphic
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.