plot() — Line chart

A line chart that shows how something changes over time.

plot(x, y, type = "l")

Key idea

In plain words

It is like a dot-to-dot. Put a dot for each year, then connect them. The line you get tells the story — going up, going down, or staying the same.

Where you'd use it

Worked example 1

Money made (in $1000s) by Manic Mango next to its biggest rival, 2003–2007. A line chart makes the change over time easy to see: Mango keeps going up and passes the rival in 2007 — clearer than bars for the year-by-year story.

Frequently asked questions

When should I join points with a line?
Only when the x-axis has a meaningful order, like time.