How to Add Line to Scatter Plot in Excel (3 Practical Examples)

In this tutorial, I am going to share with you 3 practical examples of how to add lines to an Excel scatter plot. Lines may be needed to show a threshold or limit within your data, and are very useful in statistical analysis. Using lines properly can be very helpful in representing data.

To begin with, generate a scatter plot with the data set provided below. Once you have your scatter plot ready, you’ll be ready to follow along.


Example 1 – Add a Vertical Line to the Scatter Plot

Let’s add a vertical line to the following data set, which has an X column and a Y column.

Add Vertical Line to Scatter Plot in Excel

Steps:

  • Right-click on the scatter chart and click on Select Data.

Add Vertical Line to Scatter Plot in Excel

  • In the Select Data Source window, click on Add.

Add Vertical Line to Scatter Plot in Excel

  • In the Edit Series window, set Vertical Line as the Series name.
  • Select cell B8 as Series X values and cell C8 as Series Y values.

Add Vertical Line to Scatter Plot in Excel

  • Press OK and this will generate a new data point called Vertical Line.

Add Vertical Line to Scatter Plot in Excel

  • Keeping the orange data point selected, go to Chart Design > Add Chart Element > Error Bars > Percentage.

A horizontal and a vertical line appear around the selected data point.

Add Vertical Line to Scatter Plot in Excel

  • Right-click on the horizontal line and select Format Error Bars.

  • In the new window on the right side, set the horizontal line Percentage value to 0.

  • As before, right-click on the vertical line of the orange point.
  • In the Format Error Bars window, set the direction to Minus.

  • In the Error Amount option, set the Percentage value to 100%.

You now have a vertical line through your desired data point.


Example 2 – Add a Horizontal Line to the Scatter Plot

The first few steps of this method are exactly the same as the previous method. This time we will add a horizontal line to the scatter plot, again using the Error Bars option. We’ll also format the line to make it more visible.

Steps:

  • Just as we did previously, right-click on the vertical line and select Format Error Bars.

Insert Horizontal Line to Scatter Plot

  • Again, set the Percentage value to 0 and press Enter.

Insert Horizontal Line to Scatter Plot

  • Right-click on the horizontal line and go to Format Error Bars.
  • Set the direction to Minus.

Insert Horizontal Line to Scatter Plot

  • Set the Percentage value to 100%.
  • Go to the Fill and Line options.

  • Set the color to Red and the width to 1 pt.

You now have a formatted horizontal line.

Read More: How to Add Average Line to Scatter Plot in Excel


Example 3 – Adding a Slope Line to the Scatter Plot

In the previous two methods, we used only one point from our dataset to add a line to the scatter plot. Now, we are going to use two points to add a sloping line. The slope lines are very important for regression analysis.

Steps:

Adding Slope Line to Scatter Plot in Excel

  • In the new Select Data Source window, click on Add.

Adding Slope Line to Scatter Plot in Excel

  • In the Edit Series window, enter the series name Slope Line.
  • For the series X values, hold Ctrl and select cells B5 and B8.
  • For series Y values, hold Ctrl and select cells C5 and C8.
  • Simply press OK.

Adding Slope Line to Scatter Plot in Excel

Now we have a new data point named Slope Line.

Adding Slope Line to Scatter Plot in Excel

  • Select the two data points and right-click.
  • Select Change Series Chart Type.

  • In the new window that opens, go to the Combo option.
  • Click the dropdown arrow beside the Slope Line option.
  • From the dropdown options, select the icon with the name Scatter with Straight Lines.
  • Press OK.

A slope line through the selected data points will be added.

Read More: How to Add Data Labels to Scatter Plots in Excel


Download Practice Workbook


Related Articles


<< Go Back To Edit Scatter Chart in Excel | Scatter Chart in Excel | Excel Charts | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Nazmul Hossain Shovon
Nazmul Hossain Shovon

Nazmul Hossain Shovon, a BUET graduate in Naval Architecture and Marine Engineering, embarked on his career with 8 months dedicated to the Exceldemy project's triumph. Transitioning into a Software Developer role, he specialized in web add-in development. At Exceldemy, he authored about 125 blog articles and solved many visitors’ problems, refining his writing skills and delving into Excel-related topics. With a primary passion for programming and software development, Shovon continually explores new horizons, fostering professional growth in his... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo