| plot_series | R Documentation |
Line plot for one or more series over a common x index.
plot_series(data, label_x = "", label_y = "", colors = NULL)
data |
data.frame with x in the first column and series in remaining columns |
label_x |
x-axis label |
label_y |
y-axis label |
colors |
optional vector of colors for series |
Expects a data.frame where the first column is the x index and remaining columns are numeric series.
Points and lines are drawn per series; supply colors to override the palette.
returns a ggplot2::ggplot graphic
Cleveland, W. S. (1985). The Elements of Graphing Data. Wadsworth. Wickham, H. (2016). ggplot2: Elegant Graphics for Data Analysis. Springer.
x <- seq(0, 10, 0.25)
data <- data.frame(x, sin=sin(x))
head(data)
grf <- plot_series(data, colors=c("red"))
plot(grf)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.