WeCodeAcademy

Line Charts

A line chart shows how something changes in order, most often over time. Call ax.plot(x, y) once per line. Several calls on the same axes draw several lines together, which makes comparisons easy.

Add marker='o' to put a dot on each data point. That helps when there are only a few points, because the reader can see exactly where the measurements are.

Examplepython
Open in editor »
Quick check

When is a line chart the best choice?

Your turn: write the code

Draw both lines on ax and print how many lines the axes now holds.

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.