A scatter plot is best used when we want to determine whether there is a relationship or correlation between two numeric variables. Depending on how the scatter plot looks, you can infer whether the relationship between the two variables is positive or negative, strong or weak, linear or nonlinear. Adding a trend line to your scatter plot will highlight a correlation in your data if there is one.
Let’s now see how to build a scatter plot with a trend line on Tableau step-by-step. Our goal is to create a chart showing the relationship between sales and profits for each product from the Sample Superstore data source.
Step 1. Create a scatter plot
- Connect to the data source Sample – Superstore.
- Drag Sales to Columns.
- Drag Profit to You will see just one dot on your graph, but don’t worry!
- Drag Product Name and drop it on Detail on the Marks card.
- Drag Region and drop it on Color in the Marks card.
- Select Circle from the dropdown list in the Marks card and adjust the size of the dots by clicking on Size in the Marks card.
- Adapt to screen by selecting Entire View in the toolbar.
Step 2. Add a trend line to your scatterplot
- On the left pane select the Analytics section. Drag Trend Line on the view and drop it on Linear when you see the box appear.
- Right click on one of the lines and select Edit All Trend Lines. When the box opens up, untick Region and tick Show confidence bands.
Don’t wait! Contact us to learn more and continue to follow upcoming news on our website and LinkedIn channel.