Sub topic 2
The x-axis, y-axis and origin
What this chapter assumes
You should be comfortable with positive and negative numbers, including fractions and decimals. You should be able to place them in order on a number line. You should also know basic arithmetic, including subtraction. The previous chapter showed how a single number line can name a position by one number. This chapter adds a second line to name positions in a flat plane.
By the end you will be able to name the x-axis, y-axis and origin, say what each represents, and describe where each one sits. You will also be able to test whether a point lies on an axis, and avoid the common mistakes with labels and directions.
Why one number line is not enough
A number line names a position with one number. The number 3 tells you how far to move from zero and in which direction. That works for things that vary along one dimension, such as a thermometer or a position along a road.
A flat surface has two dimensions, so one number cannot pin down a spot. A map location needs both "how far east" and "how far north". The coordinate plane is a way to give those two measurements a fixed structure. It is built from two number lines, and the rest of this chapter describes that construction.
Building the plane from two number lines
Start with an ordinary horizontal number line. Draw a second number line vertically so that it crosses the first at a right angle. Line the two up so that they cross at the zero of each. The resulting grid-like surface is the coordinate plane, also called the Cartesian plane after René Descartes.
Three named parts come out of this construction: the x-axis, the y-axis and the origin.
The x-axis
The x-axis is the horizontal number line. It records how far a point is to the left or right.
- Numbers to the right of zero are positive.
- Numbers to the left of zero are negative.
- The first coordinate of any point is its x-coordinate, and it is read along this axis.
When you move along the x-axis, only the horizontal position changes. Moving from 2 to 5 on the x-axis is a move of 3 units to the right. Moving from 2 to -1 is a move of 3 units to the left.
The y-axis
The y-axis is the vertical number line. It records how far a point is above or below the horizontal axis.
- Numbers above zero are positive.
- Numbers below zero are negative.
- The second coordinate of any point is its y-coordinate, and it is read along this axis.
When you move along the y-axis, only the vertical position changes. Moving from 1 to 4 on the y-axis is a move of 3 units up. Moving from 1 to -2 is a move of 3 units down.
The origin
The origin is the point where the two axes cross. It is the zero of both number lines at once, so its coordinates are (0, 0). Every other position on the plane is described by how far you move from the origin, first horizontally and then vertically.
The origin matters for two reasons.
- It is the reference point. A coordinate such as (3, 2) means "start at the origin, go 3 units right, then 2 units up". Without a fixed starting point, the numbers would not identify a place.
- It is the only point that lies on both axes. Every other point on an axis lies on that axis alone.
The word "origin" is often abbreviated with the capital letter O in diagrams and proofs.
Conventions you will see on every graph
Axes carry a few markings that are conventions, not laws of nature. Knowing them helps you read any graph quickly.
| Feature | Usual convention | What it tells you |
|---|---|---|
| Arrowheads on the axes | One at each end of each line | The axes continue forever in both directions |
| Letter labels | x at the right end, y at the top end | Which line is which |
| Positive direction | Right for x, up for y | How to read signs |
| Tick marks | Evenly spaced, each with a number | The scale of the axis |
| Origin label | O, or the pair (0, 0) | Where both axes equal zero |
The arrowheads are worth understanding. The plane is infinite, but a page is not. A drawing shows only a window onto the plane, and the arrows remind you that the lines continue beyond the edge of that window.
The letters x and y are the usual names, but they are only names. A science graph may use t for time on the horizontal axis and d for distance on the vertical axis. The structure is unchanged: the horizontal axis is read first, the vertical axis second.
The axes as sets of points
Each axis is a set of points that share a coordinate value. This is a useful way to think about it, because it turns a picture into a rule you can test.
- A point is on the x-axis when its y-coordinate is 0. Examples are (5, 0), (-3, 0) and (0.5, 0).
- A point is on the y-axis when its x-coordinate is 0. Examples are (0, 4), (0, -7) and (0, 0.5).
- A point is at the origin when both coordinates are 0.
Notice the direction of the rule. The x-axis is where y is zero, and the y-axis is where x is zero. This is the reverse of what many learners guess at first. It makes sense once you remember that a point on the horizontal line has no vertical offset from the origin, so its y-value is 0.
Checking axis membership in code
The rule above translates directly into a short function. This one returns the name of the axis, if any, that a point lies on.
def axis_of(x, y):
if x == 0 and y == 0:
return "origin"
if y == 0:
return "x-axis"
if x == 0:
return "y-axis"
return "neither axis"
print(axis_of(0, 0))
print(axis_of(5, 0))
print(axis_of(0, -3))
print(axis_of(2, 4))Running it prints origin, x-axis, y-axis and neither axis, one per line. The origin test comes first on purpose. If you tested y == 0 first, the point (0, 0) would be reported as on the x-axis, which is true but incomplete. Order matters whenever a point can satisfy more than one condition.
Drawing the axes with matplotlib
You can also draw the axes yourself to see the structure. This script draws the two axes as black lines, marks the origin, and labels the positive direction of each axis. It assumes the matplotlib package is installed.
import matplotlib.pyplot as plt
fig, ax = plt.subplots()
ax.axhline(0, color="black")
ax.axvline(0, color="black")
ax.set_xlim(-6, 6)
ax.set_ylim(-6, 6)
ax.set_aspect("equal")
ax.grid(True)
ax.scatter([0], [0], color="red", zorder=3)
ax.annotate("Origin (0, 0)", (0, 0), textcoords="offset points", xytext=(8, -14))
ax.set_xlabel("x (positive to the right)")
ax.set_ylabel("y (positive upward)")
plt.show()Here axhline(0) draws a horizontal line at y = 0, which is the x-axis. axvline(0) draws a vertical line at x = 0, which is the y-axis. The names can look backwards at first, so keep the rule from the previous section in mind: the line where y = 0 is the x-axis.
The call set_aspect("equal") makes one unit look the same length in both directions. Without it, matplotlib may stretch one axis, and right angles and distances would look distorted. The next chapters cover choosing a scale in more detail.
Common errors
- Swapping the axes. The x-axis is horizontal and the y-axis is vertical. A reliable memory aid is that the letter y has a long vertical stem going up and down, while x is read first and runs "across" the page.
- Reading the sign backwards. A negative x-value is to the left, not "down". A negative y-value is below, not "left".
- Treating the origin as belonging to neither axis. It lies on both.
- Assuming a point with a zero coordinate is not on the plane. Points on the axes are fully part of the plane. They simply sit on a boundary line.
- Assuming the axes always use the same unit size. The plane has no built-in size. The marks on each axis define a scale, and the two axes can use different scales on a real graph. You must read the tick labels rather than counting squares blindly.
- Believing the labels are fixed. If a graph uses other letters, the horizontal axis is still read first.
Summary
The coordinate plane is made of two perpendicular number lines that cross at zero. The horizontal line is the x-axis, with positive values to the right. The vertical line is the y-axis, with positive values upward. They cross at the origin, (0, 0), which is the starting point for describing every other position. A point is on the x-axis when y is 0, and on the y-axis when x is 0.
Exercise
For each point, say whether it lies on the x-axis, the y-axis, both, or neither: (6, 0), (0, -2), (0, 0), (-3, 4). Then describe in words how to travel from the origin to (-3, 0).
Show answer
(6, 0) is on the x-axis because its y-coordinate is 0. (0, -2) is on the y-axis because its x-coordinate is 0. (0, 0) is the origin, so it is on both axes. (-3, 4) has no zero coordinate, so it is on neither axis. To reach (-3, 0), start at the origin and move 3 units to the left along the x-axis. No vertical movement is needed.
Exercise
In the Python function axisof, suppose you moved the test if y == 0 above the test if x == 0 and y == 0. What would axisof(0, 0) return, and why is that a problem?
Show answer
It would return "x-axis". The condition y == 0 is true for the origin, so the function would exit before reaching the origin test. The answer is not false, since the origin does lie on the x-axis, but it hides the fact that the point is on both axes. The more specific test must come first.