How to Switch x and y Axis in Google Sheets

When you create a chart in Google Sheets, you will find that the software tries to understand your selected data and automatically picks a column each for your x and y-axes. However, the axes it picks might not always match what you want.

This tutorial will show you how you can switch x and y axis in Google Sheets, using the ‘Chart editor’ sidebar.

Using the Chart Editor to Switch x and y Axes in Google Sheets

Let’s say you have the following scatter chart, showing weights along the y-axis and the heights along the x-axis.  

 scatter chart

If you want to switch axes, i.e., you want to see the weight as the x-axis and height as the y-axis, follow the steps below:

  • Click anywhere on your chart or graph.
  • An ellipsis (or hamburger icon) should appear on the top right corner of the box that contains the graph.
click the ellipsis icon
  • Click on this ellipsis, and from the dropdown menu that appears, select ‘Edit chart’.
edit chart

Note: Alternatively, you could right-click the chart and select ‘Data Range’ from the context menu that appears.

  • You should now see the chart editor appear in the form of a sidebar to the right of the Google Sheets window. The Chart Editor lets you provide settings for styling your chart. It also lets you specify the sources that you want the chart to extract the data from.
chart editor
  • Select the Setup tab from the Chart editor. Here you will see all the options to change the type of chart, as well as the axes, among other things.
  • Under the X-axis category, you can see the column currently being used in the chart’s x-axis. In our case, it is the ‘Height’ column. To change this, click on the column currently listed as the x-axis (the Height).
x axis
  • This will display the list of available columns from your dataset in a dropdown menu. Select the column you want to use as your x-axis from this list. In our case, we need to select the ‘Weight’ column name.
select weight
  • Next, we need to change the column represented in the y-axis. Under the ‘Series’ category of the Chart editor, you can see the column currently being used in the chart’s y-axis. If there are more than two columns in your chart, their names will be displayed under this category as well. In such cases, the first column name in the list is generally selected to represent the y-axis. If you want to change this column, simply click on the column name (Weight in our example).
click column name
  • This will display the list of available columns from your dataset in a dropdown menu. Select the column you want to use as your y-axis from this list. In our case, we need to select the ‘Height’ column name.
select height

Once you’re done, you should see the same data, but represented with the axes switched. In this example, you should see now that the Weight is used in the x-axis, while the Height is used in the y-axis.

the x and y axes are now switched

Now, even though the actual axes have changed their source columns, the axis labels have not changed. We can still see the label of the x-axis as ‘Height’ and that of the y-axis as ‘Weight’. To change the axis labels, simply double-click on the label text and type in the new axis label. Then click anywhere outside the text container.

Click the axis labels to change them

If you want to change the columns in the axes (instead of just switching them), then a good option would be to remove one axis at a time and re-add it with a new column name. To remove an axis, click the ellipsis next to the column name listed under the ‘X-Axis’ or ‘Series’ category in the Chart Editor and then select the ‘Remove’ option from the drop-down list that appears.

remove axis

Then, to re-add a new column name, click on the ‘Add X-Axis’ or ‘Add-Series’ box, whichever is relevant and select the new column name from the dropdown menu that shows up.

select new name

That’s it! We showed you how to flip x and y axes in Google Sheets. This will update your chart to show the new x-axis or y-axis from your selected dataset.

For more tips on how to create beautiful charts, check out our guide here.

Conclusion

This tutorial showed you how to switch the x and y axes in Google Sheets charts and graphs. We also briefly showed you what to do if you want to completely change the columns that will be used to represent the x or y axes of your chart. We tried to keep the tutorial simple and to the point. We hope you found it useful and easy to follow.

Nahid

Nahid

Nahid Akhter is a writer, programmer, and online course content creator. She has an MS in Computer Science and has been in the education line for more than 14 years. Her specialization is in programming and Tech-writing, and her areas of interest include Office productivity, Artificial Intelligence, and Web design and development.