Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Scatter Graph Excel: How to Plot 2 Variables

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Creating a scatter graph in Excel with two variables allows you to visualize the relationship or correlation between two numerical data sets. To achieve this, you simply highlight two adjacent columns of numeric data and select the Scatter chart type from the Insert menu. This process transforms raw numbers into a visual map where each dot represents a single observation, helping you identify if one variable increases as the other does, or if there is no relationship at all.

What You'll Need

  • Microsoft Excel installed on your PC, Mac, or accessed via a web browser.
  • A dataset containing two columns of numerical values. One column must represent the independent variable (X-axis) and the other the dependent variable (Y-axis).
  • Clean data: Ensure there are no text strings, empty cells, or symbols (like currency signs typed manually) within the numeric data range.

Step-by-Step

  1. Organize Your Data: Arrange your data in two adjacent columns. By default, Excel treats the leftmost column as the X-axis (horizontal) and the rightmost column as the Y-axis (vertical). For example, if you are measuring how study hours affect test scores, put "Study Hours" in Column A and "Test Scores" in Column B. Ensure each row represents one individual record.
  2. Select the Data Range: Click and drag your mouse to highlight the cells containing the numbers for both variables. Include the header row (the titles of your columns) in your selection, as Excel will use these to automatically label your chart.
  3. Insert the Scatter Chart: Navigate to the Insert tab on the top ribbon. In the Charts group, look for the icon that looks like a cluster of dots (the Scatter chart icon). Click this icon and select the first option, "Scatter," which displays only the markers without any connecting lines.
  4. Verify Axis Assignment: Once the chart appears, check that the correct variable is on the X-axis. If Excel swapped them, right-click anywhere on the chart area and choose Select Data. In the dialog box, select the data series on the left and click Edit. Here, you can manually re-select the range for "Series X values" and "Series Y values."
  5. Add Axis Titles: A graph without labels is difficult to interpret. Click the chart to reveal the Chart Design tab. Click Add Chart Element (located on the far left of the ribbon), hover over Axis Titles, and select both "Primary Horizontal" and "Primary Vertical." Click the resulting text boxes on the graph to type in your specific variable names.
  6. Customize the Scale: If your data points are clustered in one small area, the graph may look empty. Right-click on the numbers of the X or Y axis and select Format Axis. In the Format pane that opens on the right, under Axis Options, you can change the "Minimum" and "Maximum" bounds to zoom in on your data.
  7. Add a Trendline: To see the general direction of the relationship, click the + button (Chart Elements) at the top right of the chart (on Windows) or go to Add Chart Element > Trendline. Choose "Linear" for a straight-line relationship.
  8. Display the R-squared Value: To quantify the strength of the correlation, right-click the trendline you just added and select Format Trendline. In the options pane, scroll down and check the box for "Display Equation on chart" and "Display R-squared value on chart."

Common Mistakes

One of the most frequent errors is attempting to create a scatter plot using a "Line Chart." While they look similar, a Line Chart treats the X-axis as a series of categories (labels) rather than numerical values. This means if your X-axis values are not perfectly sequential (e.g., 1, 2, 3), a Line Chart will plot them at equal intervals regardless of their actual value, completely distorting the correlation. Always use the specific Scatter chart type for two numeric variables.

Another common mistake is including non-numeric data within the selection range. If you have a column of names or dates mixed in with your numbers, Excel may become confused about which column is the X-axis. Ensure you are selecting only the numeric columns. If you have a "Name" column, keep it to the left of your X-variable, but do not include it in the actual chart selection unless you are using a more advanced data mapping technique.

Users also often forget to format their axes. If your data ranges from 1,000 to 1,100, Excel might start the axis at 0, leaving a massive gap of empty space and making your data points look like a flat line. Always check the axis bounds to ensure the visual representation is meaningful.

Tips

To make your graph more professional, use the Chart Styles gallery under the Chart Design tab. This allows you to quickly change the background color, marker style, and font without manually editing every element. For academic or business reports, a clean white background with dark markers is usually preferred over the default colorful gradients.

If you have a very large dataset with thousands of points, the markers may overlap, creating a solid blob of color (known as overplotting). To fix this, right-click a data point, select Format Data Series, go to the Fill & Line (paint bucket) icon, click Marker, and then Fill. Lower the "Transparency" slider to 50% or 70%. This allows you to see where points are densely packed because the colors will darken in those areas.

For those comparing multiple groups on one graph, you can add a second variable set. Instead of selecting all data at once, create the first scatter plot, then right-click the chart, choose Select Data, and click Add. This allows you to define a new X and Y range for a second series, which will appear in a different color on the same axes.

Troubleshooting

If the chart is blank: This usually happens when Excel interprets your numbers as text. Check your cells for leading spaces or currency symbols that were typed manually rather than applied via cell formatting. To fix this, select the data, go to the Home tab, and change the number format dropdown from "Text" to "Number." You may need to re-enter the data or use the "Text to Columns" feature to force a conversion.

If the X and Y axes are swapped: This is a common occurrence if your data isn't arranged with the independent variable on the left. You do not need to move your columns. Right-click the chart, go to Select Data, select your series, click Edit, and swap the cell ranges in the X and Y value boxes.

If the trendline doesn't fit the data: Not all relationships are linear. If your dots form a curve, a straight linear trendline will be misleading. In the Format Trendline pane, experiment with "Exponential," "Logarithmic," or "Polynomial" options to see which line more accurately follows the path of the data points.

If the markers are too large: In the Format Data Series menu, under Marker > Marker Options, you can change the size of the dots. Reducing the size is essential for high-density datasets to avoid visual clutter.

Frequently Asked Questions

Can I use a scatter plot for dates?

Yes, Excel recognizes dates as serial numbers. If one of your variables is a date, Excel will plot it chronologically along the axis, making it an excellent tool for time-series correlation.

What is the difference between a scatter plot and a bubble chart?

A scatter plot handles two variables (X and Y). A bubble chart adds a third variable, which determines the size of each individual marker (the "bubble"), allowing you to visualize three dimensions of data on a 2D plane.

How do I change the color of the dots?

Right-click any dot in the series, select Format Data Series, click the Fill & Line (paint bucket) icon, expand the Marker section, and choose a new color under Fill.

Why is my R-squared value 1.0?

An R-squared of 1.0 means there is a perfect linear correlation between your two variables. While possible in theoretical physics or math, in real-world data, this often suggests that one variable is a direct calculation of the other, or there is an error in the data entry.

Can I add a second Y-axis for a different variable?

Yes. After adding a second data series, right-click the new series markers and select Format Data Series. In the Series Options, select "Secondary Axis." This creates a second vertical axis on the right side of the chart.