Skip to content
ihateDesmos

The x and y axis

4 min read · Updated 6 November 2026

The x-axis is the horizontal line on a graph, and the y-axis is the vertical line. They cross at the origin, (0, 0), and together they let you locate any point using two numbers.

Which axis is which?

  • The x-axis is horizontal. It runs left and right, with positive numbers to the right.
  • The y-axis is vertical. It runs up and down, with positive numbers going up.

A memory aid: the capital letter Y has a tail that points straight down, like the vertical axis. Or think “x is a cross”, and you cross a room horizontally.

−4−224−220
Open in calculator
The horizontal x-axis and the vertical y-axis, crossing at the origin, with a point in each quadrant.

Reading coordinates

A point is written as (x, y). The first number says how far to go across, and the second says how far up. So (3, 2) is 3 to the right and 2 up, while (−2, 3) is 2 to the left and 3 up. The order matters: (3, 2) and (2, 3) are different points. Our guide to plotting points goes through this in detail.

The graphs of x = a and y = b

These two catch out a lot of people:

  • y = 3 is a horizontal line. Every point on it has a y-value of 3, whatever x is.
  • x = 3 is a vertical line. Every point on it has an x-value of 3, whatever y is.

So the x-axis itself is the line y = 0, and the y-axis is the line x = 0.

−4−224−2240
Open in calculator
y=3
is horizontal, in blue, and
x=3
is vertical, in red.

Which variable goes on which axis?

When you draw a graph of real data, put the independent variable on the x-axis and the dependent variable on the y-axis. The independent variable is the one you choose or control, and the dependent variable is what you measure in response.

Situationx-axis (independent)y-axis (dependent)
A plant’s growthTimeHeight
Studying and scoresHours studiedTest score
A car journeyTimeDistance

Time almost always goes on the x-axis. The scatter plot maker and line graph maker let you draw your own.

The four quadrants

QuadrantWherexy
ITop rightPositivePositive
IITop leftNegativePositive
IIIBottom leftNegativeNegative
IVBottom rightPositiveNegative

Frequently asked questions

Is the x-axis horizontal or vertical?
Horizontal. The x-axis runs left to right, and the y-axis runs up and down.
What is the line y = 2?
A horizontal line that crosses the y-axis at 2.
What is the line x = 2?
A vertical line that crosses the x-axis at 2.
What is the origin?
The point where the axes cross, (0, 0).
What goes on the y-axis?
The dependent variable: the quantity you measure, which depends on the x value.

Keep going

Try it in the calculator

Every figure on this page opens in ihateDesmos, where you can drag sliders and watch the graph respond.

Open the calculator