X and Y axis: definition, equation, and examples

If you need to plot a 2D graph using coordinates or an equation describing them, you’ll need to know about the X and Y axes, what they represent, and the order in which to use them. In this guide, you will learn about the X and Y axes and how to use them to plot coordinates on a 2D graph. You will also learn how to use the scatter chart in Google Sheets.

First, you will learn how to plot coordinates in the form of ordered pairs. After that, you will learn how to find coordinates using different types of equations. Finally, you will learn how to switch the X and Y axes in your Google Sheets graphs.

What is the X and Y axis?

The coordinate grids on a 2D graph have two perpendicular lines called axes. These axes are labeled like number lines, and the point where they intersect is called the origin. The horizontal axis is usually called the X-axis, and the vertical one is called the Y-axis.

Which is first: X or Y?

All points on the plane of these axes are defined by their coordinates, given by an ordered pair (X,Y). For example, the coordinates of the origin are (0,0). The order is important when communicating these coordinates, and x always goes first. In the next section, you have several examples to illustrate this.

Examples of using the X and Y axis

Now that you know what the X and Y axes are, let’s see how you can use them to plot coordinates on a graph, whether they are in the form of ordered pairs or an equation describing the relationship between X and Y.

Plot coordinates on a graph

First, let’s see how to plot coordinates on a graph manually.

1. You’ve been given a set of ordered pairs that need to be plotted on a graph.

Coordinates: (1,2), (2,3), (3,4), (4,3)

2. Your graph should have perpendicular lines that cross at (0,0). Each line should be divided into equal units, like a number line.

X and Y axis — empty coordinate grid with the X and Y axes crossing at the origin

3. On the X-axis, find the first number in the first ordered pair.

4. Move up perpendicular to the X-axis until you reach the second number of the ordered pair.

5. Mark the spot.

X and Y axis — first ordered pair marked on the coordinate grid

6. Repeat steps 3-5 for each ordered pair, as shown below.

X and Y axis — four ordered pairs plotted on the coordinate grid

Plot coordinates on a graph using Google Sheets

Now, let’s see how to plot the coordinates from the previous example using Google Sheets. First, you need to organize the coordinates in tabular form, then use a scatter chart to graph them.

1. Open Google Sheets.

X and Y axis in Google Sheets — blank Google Sheets spreadsheet ready for the coordinate table

2. Create a two-column table with the ordered pairs, as shown below.

X and Y axis in Google Sheets — two-column Google Sheets table holding the X and Y values

3. Select the cells containing the X and Y coordinates, and go to Insert > Chart. If you have not built one before, the guide to inserting a chart in Google Sheets covers every chart type.

X and Y axis in Google Sheets — X and Y columns selected with the Insert menu open

4. From the ‘Chart editor’, under ‘Chart type’, select the ‘Scatter chart’. Below, you can see that the coordinates have been plotted on the graph.

X and Y axis in Google Sheets — scatter chart plotting the four ordered pairs from the table

Plot equations on a graph using Google Sheets

Now that you know how easy it is to plot coordinates using Google Sheets, it’s time to learn how to plot an equation describing the relationship between X and Y values. First, you need to create the Y values using the equation. Once you have these, you can graph them using a scatter chart.

Plot linear equations in Google Sheets

In this example, you will learn how to plot a linear equation using Google Sheets. The equation is the following:

y = 3x + 3

1. Open Google Sheets and add column headers for X and Y, as shown below.

X and Y axis in Google Sheets — X and Y column headers added in Google Sheets

2. For the X values, type the numbers from 1 to 10, one per row.

X and Y axis in Google Sheets — X column filled with the numbers 1 to 10 in Google Sheets

3. In the cell where you want the first Y value, type in the equation, replacing the X with the cell reference for the first value of X, as shown below.

X and Y axis in Google Sheets — linear equation typed into the first Y cell in Google Sheets

4. Grab the fill handle and drag it down to the last value.

X and Y axis in Google Sheets — fill handle dragged down the Y column in Google Sheets

5. Select the values for X and Y and go to Insert > Chart.

X and Y axis in Google Sheets — Insert menu open over the selected X and Y values in Google Sheets

6. Make sure the chart type is a ‘Scatter chart’.

X and Y axis in Google Sheets — scatter chart of y = 3x + 3 for X values 1 to 10

7. You can add a trendline and use the equation as the label. Go to ‘Customize’ in the ‘Chart editor’ and click on ‘Series’. Scroll down, check the ‘Trendline’ checkbox, and select ‘Equation’ under ‘Label’.

X and Y axis in Google Sheets — Chart editor with trendline enabled and the equation set as the label

Plot quadratic equations in Google Sheets

In this example, you will learn how to plot a quadratic equation on a Google Sheets scatter chart. The equation is as follows:

y = 4x^2

1. In Google Sheets, add column headers for X and Y. In the first column, type the numbers from 1 to 10, one per row.

X and Y axis in Google Sheets — X column filled with 1 to 10 for the quadratic example in Google Sheets

2. In the cell where you want the first Y value, type in the equation, replacing the X with the cell reference for the first value of X, as shown below.

X and Y axis in Google Sheets — quadratic equation typed into the first Y cell in Google Sheets

3. Grab the fill handle and drag it down to get the rest of the Y values.

X and Y axis in Google Sheets — quadratic formula filled down the Y column in Google Sheets

4. Select the cells with the X and Y values and go to Insert > Chart.

X and Y axis in Google Sheets — Insert menu open over the quadratic X and Y values in Google Sheets

5. Check that the chart type is the ‘Scatter chart’.

X and Y axis in Google Sheets — scatter chart of the quadratic equation in Google Sheets

How to switch the X and Y axis?

When creating graphs or charts, Google Sheets takes a pretty good guess at the type of chart you want, and which values are on the X and Y axes. However, you may need to switch them to visualize data more clearly. As the expectation is that X values will be on the horizontal axis, be sure to change the labels to avoid confusion.

You already know how to change the chart type, but how do you switch the axes? Follow the instructions below to flip the axes on your Google Sheets graph.

1. Select your chart and double click to get the ‘Chart editor’.

X and Y axis in Google Sheets — Google Sheets Chart editor panel open on the Setup tab

2. In the ‘Setup’ tab, you can see the selection for the ‘X-axis’ and the ‘Y-axis’, labeled as ‘Series’. Use the dropdown menus to switch them.

X and Y axis in Google Sheets — Chart editor dropdowns used to swap the X-axis and Series values

3. That’s it. However, the Y-axis label needs to be changed, too.

X and Y axis in Google Sheets — chart showing the old Y-axis label after the axes were switched

4. Right-click to get the menu or go to ‘Chart & axis titles’ in the ‘Customize’ tab.

X and Y axis in Google Sheets — Chart and axis titles option open in the Customize tab

5. That’s it. The X and Y axes have been switched.

X and Y axis in Google Sheets — finished Google Sheets chart with the X and Y axes switched

Conclusion

It’s easy to work with coordinate grids. You can easily plot coordinates on a 2D graph using ordered pairs. However, it’s even easier to do it in Google Sheets. You have step-by-step instructions on how to organize X and Y values in tabular form and how to graph them using a scatter chart in Google Sheets.

You also know how to find coordinates using different types of equations and use the scatter chart to graph them. The same axis settings apply to other chart types, so it is worth reading how to make a line graph and how to create a bar chart in Google Sheets. Finally, you know how to switch the X and Y axes and when it’s appropriate to do so.

You may also like…

google sheets features and formulas

Top 5 dynamic array formulas in Google Sheets 

Google Sheets has evolved beyond basic spreadsheets. With the introduction of dynamic array formulas, users can now manipulate and analyze...
google sheets features and formulas

Mastering the FILTER Formula: 4 Use Cases with Examples

The FILTER formula in Google Sheets is a versatile tool for extracting data that meets specific conditions. Unlike the QUERY formula,...
google sheets features and formulas

Unlocking the Power of SUMIF and SUMIFS in Google Sheets: 4 real-life use cases

The SUMIF and SUMIFS formulas in Google Sheets are indispensable tools for performing conditional summations. They simplify complex...