Learn R Programming

daltoolbox (version 1.2.747)

plot_points: Plot points

Description

Dot chart for multiple series across categories (points only).

Usage

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

Value

returns a ggplot2::ggplot graphic

Arguments

data

data.frame with category + one or more numeric columns

label_x

x‑axis label

label_y

y‑axis label

colors

optional color vector for series

Details

Expects a data.frame with category in the first column and one or more numeric series. Points are colored by series (legend shows original column names). Supply colors to override the palette.

Examples

Run this code
x <- seq(0, 10, 0.25)
data <- data.frame(x, sin=sin(x), cosine=cos(x)+5)
head(data)

grf <- plot_points(data, colors=c("red", "green"))
plot(grf)

Run the code above in your browser using DataLab