Graphing Vertical and Horizontal Lines

Graphing Vertical and Horizontal Lines

Can we graph an equation with only one variable? Just \(x\) and no \(y\), or just \(y\) without an \(x\)? How will we make a table of values to get the points to plot?

Let’s consider the equation \(x=-3\). This equation has only one variable, \(x\). The equation says that \(x\) is always equal to \(-3\), so its value does not depend on \(y\). No matter what \(y\) is, the value of \(x\) is always \(-3\).

So to make a table of values, write \(-3\) in for all the \(x\) values. Then choose any values for \(y\). Since \(x\) does not depend on \(y\), you can choose any numbers you like. But to fit the points on our coordinate graph, we’ll use 1, 2, and 3 for the y-coordinates. See the table below.

\(x=-3\)
\(x\) \(y\) \(\left(x,y\right)\)
\(-3\) 1 \(\left(-3,1\right)\)
\(-3\) 2 \(\left(-3,2\right)\)
\(-3\) 3 \(\left(-3,3\right)\)

Plot the points from the table above and connect them with a straight line. Notice in the figure below that we have graphed a vertical line.

The figure shows a vertical straight line drawn through three points on the x y-coordinate plane. The x-axis of the plane runs from negative 7 to 7. The y-axis of the plane runs from negative 7 to 7. Dots mark off the three points which are labeled by their ordered pairs (negative 3, 1), (negative 3, 2), and (negative 3, 3). A vertical straight line goes through all three points. The line has arrows on both ends pointing to the outside of the figure. The line is labeled with the equation x equals negative 3.

Vertical Line

A vertical line is the graph of an equation of the form \(x=a\).

The line passes through the x-axis at \(\left(a,0\right)\).

Example

Graph the equation \(x=2\).

Solution

The equation has only one variable, \(x\), and \(x\) is always equal to 2. We create the table below where \(x\) is always 2 and then put in any values for \(y\). The graph is a vertical line passing through the x-axis at 2. See the figure below.

\(x=2\)
\(x\) \(y\) \(\left(x,y\right)\)
2 1 \(\left(2,1\right)\)
2 2 \(\left(2,2\right)\)
2 3 \(\left(2,3\right)\)
The figure shows a straight vertical line drawn through three points on the x y-coordinate plane. The x-axis of the plane runs from negative 7 to 7. The y-axis of the plane runs from negative 7 to 7. Dots mark off the three points which are labeled by their ordered pairs (2, 1), (2, 2), and (2, 3). A vertical straight line goes through all three points. The line has arrows on both ends pointing to the outside of the figure. The line is labeled with the equation x equals 2.

What if the equation has \(y\) but no \(x\)? Let’s graph the equation \(y=4\). This time the y- value is a constant, so in this equation, \(y\) does not depend on \(x\). Fill in 4 for all the \(y\)’s in the table below and then choose any values for \(x\). We’ll use 0, 2, and 4 for the x-coordinates.

\(y=4\)
\(x\) \(y\) \(\left(x,y\right)\)
0 4 \(\left(0,4\right)\)
2 4 \(\left(2,4\right)\)
4 4 \(\left(4,4\right)\)

The graph is a horizontal line passing through the y-axis at 4. See the figure below.

The figure shows a straight horizontal line drawn through three points on the x y-coordinate plane. The x-axis of the plane runs from negative 7 to 7. The y-axis of the plane runs from negative 7 to 7. Dots mark off the three points which are labeled by their ordered pairs (0, 4), (2, 4), and (4, 4). A straight horizontal line goes through all three points. The line has arrows on both ends pointing to the outside of the figure. The line is labeled with the equation y equals 4.

Horizontal Line

A horizontal line is the graph of an equation of the form \(y=b\).

The line passes through the y-axis at \(\left(0,b\right)\).

Example

Graph the equation \(y=-1.\)

Solution

The equation \(y=-1\) has only one variable, \(y\). The value of \(y\) is constant. All the ordered pairs in the table below have the same y-coordinate. The graph is a horizontal line passing through the y-axis at \(-1\), as shown in the figure below.

\(y=-1\)
\(x\) \(y\) \(\left(x,y\right)\)
0 \(-1\) \(\left(0,-1\right)\)
3 \(-1\) \(\left(3,-1\right)\)
\(-3\) \(-1\) \(\left(-3,-1\right)\)
The figure shows a straight horizontal line drawn through three points on the x y-coordinate plane. The x-axis of the plane runs from negative 7 to 7. The y-axis of the plane runs from negative 7 to 7. Dots mark off the three points which are labeled by their ordered pairs (negative 3, negative 1), (0, negative 1), and (3, negative 1). A straight horizontal line goes through all three points. The line has arrows on both ends pointing to the outside of the figure. The line is labeled with the equation y equals negative 1.

The equations for vertical and horizontal lines look very similar to equations like \(y=4x.\) What is the difference between the equations \(y=4x\) and \(y=4\)?

The equation \(y=4x\) has both \(x\) and \(y\). The value of \(y\) depends on the value of \(x\). The y-coordinate changes according to the value of \(x\). The equation \(y=4\) has only one variable. The value of \(y\) is constant. The y-coordinate is always 4. It does not depend on the value of \(x\). See the table below.

\(y=4x\) \(y=4\)
\(x\) \(y\) \(\left(x,y\right)\) \(x\) \(y\) \(\left(x,y\right)\)
0 0 \(\left(0,0\right)\) 0 4 \(\left(0,4\right)\)
1 4 \(\left(1,4\right)\) 1 4 \(\left(1,4\right)\)
2 8 \(\left(2,8\right)\) 2 4 \(\left(2,4\right)\)

The figure shows a two straight lines drawn on the same x y-coordinate plane. The x-axis of the plane runs from negative 7 to 7. The y-axis of the plane runs from negative 7 to 7. One line is a straight horizontal line labeled with the equation y equals 4. The other line is a slanted line labeled with the equation y equals 4x.

Notice, in the figure above, the equation \(y=4x\) gives a slanted line, while \(y=4\) gives a horizontal line.

Example

Graph \(y=-3x\) and \(y=-3\) in the same rectangular coordinate system.

Solution

Notice that the first equation has the variable \(x\), while the second does not. See the table below. The two graphs are shown in the figure below.

\(y=-3x\) \(y=-3\)
\(x\) \(y\) \(\left(x,y\right)\) \(x\) \(y\) \(\left(x,y\right)\)
0 0 \(\left(0,0\right)\) 0 \(-3\) \(\left(0,-3\right)\)
1 \(-3\) \(\left(1,-3\right)\) 1 \(-3\) \(\left(1,-3\right)\)
2 \(-6\) \(\left(2,-6\right)\) 2 \(-3\) \(\left(2,-3\right)\)
The figure shows a two straight lines drawn on the same x y-coordinate plane. The x-axis of the plane runs from negative 7 to 7. The y-axis of the plane runs from negative 7 to 7. One line is a straight horizontal line labeled with the equation y equals negative 3. The other line is a slanted line labeled with the equation y equals negative 3x.

This lesson is part of:

Graphs and Equations

View Full Tutorial

Track Your Learning Progress

Sign in to unlock unlimited practice exams, tutorial practice quizzes, personalized weak area practice, AI study assistance with Lexi, and detailed performance analytics.