powered by
This function creates a scatter plot using ggplot2.
plot_points(data, label_x = "", label_y = "", colors = NULL)
returns a ggplot graphic
data.frame contain x, value, and variable
x-axis label
y-axis label
color vector
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