Need to learn how to add data labels to a Scatter Plot in Excel? We may frequently need to produce a Scatter Plot. After producing this kind of Scatter Plot, go through the following steps to add data labels to the plot to make it easier to interpret. Here, we will take you through 2 easy and convenient methods on how to add data labels to a Scatter Plot in Excel.
Download Practice Workbook
You may download the following Excel workbook for better understanding and practice yourself.
2 Methods to Add Data Labels to Scatter Plot in Excel
Adding data labels to a Scatter Plot includes some easy steps. In this article, we’ll show you how to add data labels to a Scatter Plot in Excel with 2 different methods.
Suppose, we have a Weight List of some individuals.
We wanna plot the Weight according to the Name of the individual in a Scatter Plot. Also, we want to add data labels to the chart to make it more understandable. Without any further delay, let’s get into the methods to do it.
1. Using Chart Elements Options to Add Data Labels to Scatter Chart in Excel
In our first method, we’ll manually add data labels to the Scatter Plot using the Chart Elements option in Excel. But, before adding the data labels, we have to make the chart from our data table. Follow our steps below very carefully.
Steps:
- At first, select cells in the B4:C14 range. There are 2 columns in this selected range of cells. The first one is for the Name and the second one is for the Weight (lbs).
- Then, go to the Insert tab.
- After that, select Insert Scatter(X, Y) or Bubble Chart > Scatter.
- At this moment, we can see the Scatter Plot visualizing our data table.
- Secondly, go to the Chart Design tab.
- Now, select Add Chart Element from the ribbon.
- From the drop-down list, select Data Labels.
- After that, click on More Data Label Options from the choices.
- By our previous action, a task pane named Format Data Labels opens.
- Firstly, click on the Label Options icon.
- In the Label Options, check the box of Value From Cells.
- Then, select the cells in the B5:B14 range in the Select Data Label Range box. These cells contain the Name of the individuals which we’ll use as our data labels. After that, click OK.
- Later, uncheck the box of Y Value in the Label Options.
- Finally, our Scatter Plot with data labels looks like the one below.
- But, from the image above, we can clearly notice that the data labels of Susan and James look partially unified.
- So, click on the data label James two times to select this label only.
- It also opens the Format Data Label task pane.
- Now, set the Label Position as Above.
- At this moment, it is more visible than before. But not fully distinguishable.
- So, select the data label James again.
- From Label Options, go to Effects.
- Under the Shadow category, select the shadow as the image below from the Presets.
- Finally, our data labels are clearly perceivable from one another.
- With the data range, our Scatter Plot with data labels looks like the one below.
Read More: How to Make a Scatter Plot in Excel with Two Sets of Data (in Easy Steps)
2. Applying VBA Code to Add Data Labels to Scatter Plot in Excel
Another alternative to solve the problem is to apply the VBA code to run a Macro. Follow our steps below.
- At first, right-click on the Sheet Name (VBA).
- Then, select View Code from the options.
- At this point, the Microsoft Visual Basic for Applications window opens.
- Now, go to the Insert tab and select Module.
- It opens a code module where you need to paste the code below.
Sub AddDataLabels()
If Left(TypeName(Selection), 5) <> "Chart" Then
MsgBox "Please select the scatter plot first."
Exit Sub
End If
Set StartLabel = _
Application.InputBox("Click on the cell containing the first label", Type:=8)
Application.ScreenUpdating = False
For Each pt In ActiveChart.SeriesCollection(1).Points
pt.ApplyDataLabels xlDataLabelsShowValue
pt.DataLabel.Caption = StartLabel.Value
Set StartLabel = StartLabel.Offset(1)
Next
End Sub
💡 Explanation of VBA Code:
- Sub AddDataLabels(): This part names the macro.
- If Left(TypeName(Selection), 5) <> “Chart” Then: This means, if the chart is not selected. <> operator means address is not equal to.
- MsgBox “Please select the scatter plot first.”: If the above part is true, then it shows a message box containing Please select the scatter plot first.
- Application.InputBox(“Click on the cell containing the first label”, Type:=8): This box required an input to recognize the first point’s data label. To get a range from the user we set Type to 8.
- Application.ScreenUpdating = False: Disable the screen updating at the start of the subroutine to speed up your macro.
- For Each pt In ActiveChart.SeriesCollection(1).Points: This indicates points in series one on the selected chart.
- pt.ApplyDataLabels xlDataLabelsShowValue: It applies data labels to each point and displays the data label.
- pt.DataLabel.Caption = StartLabel.Value: It applies captions to the data labels and they are set as the range we selected in the input box.
- Set StartLabel = StartLabel.Offset(1): This move down the selection to the next cell which means the cell in the lower row.
- Then click on the Save icon to save the workbook in Macro-Enabled format.
- Then, go to the Developer tab.
- After that, select Macros from the ribbon.
- At this point, a Macro wizard opens.
- Later, select our created macro AddDataLabels and click on Run.
- However, it shows an error message that Please select the Scatter plot first. Because we can see that we selected cell D2 instead of selecting the chart prior to running this macro.
- So, first, select the chart, then run the macro again.
- It opens an Input wizard.
- Later, give cell B5 as a reference in the Click on the cell containing the first label box. This means the text string in cell B5 is the data label of the first point.
- At last, click on OK.
- Finally, we have our Scatter Plot visible with data labels.
Read More: How to Add Text to Scatter Plot in Excel (2 Easy Ways)
How to Remove Data Labels
In the previous section, we learned how to add data labels in a Scatter Plot. It’s also important to know how to remove them. Follow the ways we stated below to remove data labels from a Scatter Plot.
1. Using Add Chart Element
- At first, go to the sheet Chart Elements.
- Then, select the Scatter Plot already inserted.
- After that, go to the Chart Design tab.
- Later, select Add Chart Element > Data Labels > None.
- This is how we can remove the data labels.
Read More: Use Scatter Chart in Excel to Find Relationships between Two Data Series
2. Pressing the Delete Key
If you want to select all the data labels in a data series, click it once. Otherwise, click on it twice to select this label only. Now, press the DELETE key on the keyboard to remove data labels from the Scatter Plot.
3. Utilizing the Delete Option
- Again, go to the sheet named Chart Elements.
- Then, right-click on any data label.
- Later, select Delete from the option.
Hence, you can remove data labels from your Scatter Plot.
Read More: How to Add Line to Scatter Plot in Excel (3 Practical Examples)
Conclusion
Thank you for reading this article, we hope this was helpful. Please let us know in the comment section if you have any queries or suggestions. Please visit our website Exceldemy to explore more.
Related Articles
- How to Add Regression Line to Scatter Plot in Excel
- Make a Scatter Plot in Excel with Multiple Data Sets
- How to Add Average Line to Scatter Plot in Excel (3 Ways)
- Connect Dots in Scatter Plot in Excel (with Easy Steps)
- How to Add Multiple Series Labels in Scatter Plot in Excel
- Make a Correlation Scatter Plot in Excel (2 Quick Methods)
- Combine Two Scatter Plots in Excel (Step by Step Analysis)