Press "Enter" to skip to content

Overlaying Lines with Points in Base R

Steven Sanderson adds points to those lines:

In this blog post, we’ll explore how to overlay points or lines on a plot using Base R. We’ll use the plot() function to create the initial plot and then show how to overlay points with points() and lines with lines(). We’ll provide several examples, explaining each code block in simple terms, and encourage you to try them out on your own datasets.

Read on to see how. It’s also pretty easy to do in ggplot2 or other visualization libraries.