Tableau Scatter Plot

Tableau Scatter Plot is useful to visualize the relationship between any two sets of data. In this article, we will show you how to Create a Scatter Plot in Tableau with an example. For this scatter plot in Tableau example, we write a custom SQL query.

-- SQL Query to create a Scatter Plot in Tableau
SELECT Geo.EnglishCountryRegionName, 
       Geo.StateProvinceName, 
       Geo.City, 
       Geo.PostalCode, 
       Fact.OrderQuantity, 
       Fact.TotalProductCost, 
       Fact.SalesAmount, 
       Fact.TaxAmt, 
       Fact.OrderDate
FROM FactInternetSales AS Fact 
   INNER JOIN
     DimCustomer AS Cust ON Fact.CustomerKey = Cust.CustomerKey
   INNER JOIN
     DimGeography AS Geo ON Cust.GeographyKey = Geo.GeographyKey

How to Create a Scatter Plot in Tableau

To create a Scatter plot in Tableau, drag and drop the Order Quantity from Measures Region to Rows Shelf and Sales Amount from Measures region to Columns Shelf. The Tableau intelligence will automatically select the scatter plot, and if it does not, please select the Scatter plot option from the Show Me window.

Tableau Scatter Plot 1

As you see that it is showing the aggregated data. But, we require to see the detailed information. So, let me drag and drop the Postal Code from Dimensions Region to Details field present in Marks Shelf.

Tableau Scatter Plot 2

Add Linear Progression to Scatter Plot in Tableau

This example shows how to add the linear progression to the scatter plot. The Tableau provides two different ways to add linear progression.

First Approach: You can add the progression, or Trend lines using the Trend Line option available in the Tableau. To access this option, Please navigate to the Analytics tab.

Tableau Scatter Plot 3

Next, Drag and drop the Tableau Trend Line to the Plotting area.

Tableau Scatter Plot 4

Second Approach: Right-click on the Plotting area and select the Trend Lines, and click on the Show Trend Lines option.

Tableau Scatter Plot 5

Once you click on the Show Trend Lines option, Tableau scatter plot will show the Trendline, along with the confidence bands.

Tableau Scatter Plot 6

By default, Tableau will add the confidence bands to the Trendline, but you can alter these default settings. To do so, right-click on the Plotting area and select the Trend Lines, and click on the Edit Trend Lines …option.

Tableau Scatter Plot 7

It will open a new window called the Trend Lines Options. Here you can change the default Linear Model to Logarithmic, Exponential, Polynomial, etc. Here, we will remove the Confidence bars. To do this, please uncheck the Show Confidence bands option.

Tableau Scatter Plot 8

It removes the Tableau confidence bars

Tableau Scatter Plot 9

Remove Scatter Plot Trend Line

Right-click on the Plotting area will open the context menu. Please select the Trend Lines, and uncheck the Show Trend Lines option.

Tableau Scatter Plot 10

Add Colors to Scatter Plot

This example shows how to add colors to the Tableau scatter plot. For this, drag and drop the English Country Region Name from Dimensions Region to Color field in Marks Shelf. It means each country has its own color

Tableau Scatter Plot 11

Add Multiple Trend Lines to a Scatter Plot in Tableau

This example shows how to add the trend line for each region in a scatter plot. Right-click on the Plotting area will open the context menu. Please select the Trend Lines, and click on the Show Trend Lines option.

Tableau Scatter Plot 12

It will create the Tableau Trend Line for each country.

Tableau Scatter Plot 13

Change the Size of a Scatter Plot

Let me show you how to change the size of a dot. For this, drag and drop the English Country Region Name from Dimensions Region to Size field in the Marks Shelf, as shown below. It means each country has its own size

Tableau Scatter Plot 14

Change the Scatter Plot Shape of a ring

To change the Tableau scatter plot default ring shape, click on the Shape field in Marks Shelf. It will open the list of available shapes. Please select the required shape.

Tableau Scatter Plot 15

We changed the default ring shape to star

Tableau Scatter Plot 16

Create Category wise Scatter Plot

To create a Tableau scatter plot for each region, drag the English Country Region Name from Dimensions Region to Rows Shelf.

Tableau Scatter Plot 17

Add Labels to a Scatter Plot

It shows how to add labels to each dot in a Tableau scatter plot. For this, drag and drop the Order Quantity from the Measures Region to Label field in Marks Shelf.

Tableau Scatter Plot 18