← All simulations · Pillar 1: Numbers & pictures

Coordinates & the graph

What it is

A coordinate is an address for a point. Two numbers — an across (x) and an up (y) — pin it to one exact spot on a grid. We always write the pair in the same order, (x, y), x first. Once everything in your data is a pair of numbers, every row becomes a point, and the whole table turns into a picture you can actually see.

Go deeper: the grid has two number lines crossing at a right angle — the axes. To read a point you drop straight down to the x-axis for its across value and straight across to the y-axis for its up value. The two numbers are independent: change one and the point slides along just that direction. This grid (often called the Cartesian plane) is the stage on which almost all of machine learning is drawn.

Why care

Every other idea on this site lives on a graph. A line of best fit, clusters, decision boundaries, nearest neighbors — all of them are points and shapes on a coordinate plane. If you can place a point and read its two numbers, you can read every picture that follows. Plotting data is also the very first thing a data scientist does, because a pattern you can see is a pattern you can study.

The idea, intuitively

Drag the marker anywhere. A dashed line drops to the bottom axis to show its x, and another runs left to show its y; the label reads the pair back to you as (x, y). Slide it sideways and only x changes; slide it up and only y changes. Then flip the scatter switch and watch a table of fruits become a constellation of dots — the same data, now a graph.

Peek at the data first

Each fruit is two numbers — sweetness and size — exactly the columns Spectra’s describe_data would list. Those two columns are all it takes to place each fruit as a point on the grid.

Try it

Drag the red marker (or tap anywhere on the grid) and read its coordinates off the dashed drop-lines. Notice that moving across changes only x and moving up changes only y. Tick Show the whole table as a scatter to plot every fruit row at once and watch the spreadsheet become a picture.

Where it shows up

Where it came from

The idea of locating any point by two numbers on crossing axes is credited to the French philosopher and mathematician René Descartes in 1637 (with Pierre de Fermat developing similar ideas independently). It linked algebra and geometry for the first time — which is why the grid is still called the Cartesian plane today.

Try it in code

In the Studio, describe_data shows the table of numbers behind any picture — the two columns that become a point’s x and y:

data = load "fruits"
describe_data data

Open it in the Studio ▶

Check your understanding