When creating a line plot or a scatterplot, students often have the following question:

**Which variable should I place on the x-axis and which should I place on the y-axis?**

**The short answer**: The independent variable (or “explanatory variable”) should go on the x-axis and the dependent variable (or “response variable”) should go on the y-axis.

Another way to phrase it: the variable that can be viewed as “explanatory” should go on the x-axis and the variable that is “being explained” should go on the y-axis.

The following examples show how to choose which variable to place on each axis in practice.

**Example 1: Hours Studied vs. Exam Score**

Suppose a professor collects data on the following variables for students in his class:

- Number of hours studied
- Exam score received

When creating a scatterplot to visualize these two variables, he should place the following variables on each axis:

**x-axis**: Number of hours studied**y-axis**: Exam Score received

Since the exam score received is dependent on the number of hours studied, the number of hours studied belongs on the x-axis while the exam score belongs on the y-axis.

Here’s what the scatterplot would look like:

**Example 2: Food Consumption vs. Weight**

Suppose a biologist collects data on the following variables for mice in his lab:

- Grams of food fed daily
- Weight after one month

When creating a scatterplot to visualize these two variables, he should place the following variables on each axis:

**x-axis**: Grams of food fed daily**y-axis**: Weight after one month

Since the weight of each mouse is dependent on the number of grams of food they’re fed daily, the number of grams of food belongs on the x-axis while the weight belongs on the y-axis.

Here’s what the scatterplot would look like:

**Example 3: Age vs. Height**

Suppose a botanist collects data on the following variables for a certain plant:

- Height (in inches)
- Age (in weeks)

When creating a line plot to visualize these two variables, she should place the following variables on each axis:

**x-axis**: Age (in weeks)**y-axis**: Height (in inches)

Since the height of the plant is dependent on the age, the age belongs on the x-axis while the height belongs on the y-axis.

Here’s what the line plot would look like:

**Additional Resources**

The following tutorials explain the difference between different types of variables:

Qualitative vs. Quantitative Variables: What’s the Difference?

Explanatory vs. Response Variables: What’s the Difference?

Categorical vs. Quantitative Variables: What’s the Difference?