How do you do a scatter plot in Tableau?

After the bar chart and line graph, we find the scatter plot to be one of the most effective visualization options for analyzing data. A scatter plot displays data points at their respective intersections of two measures, and displays every data point on the same view. The marks can then be further encoded by up to two additional measures and/or dimensions by leveraging the Color and/or Size Marks Cards.

This ability to slice and dice data points in several ways within a condensed space provides an effective means for identifying patterns. Not only that, scatter plots provide a natural way to segment the marks into four quadrants by simply adding a reference line to each of the two axes. You can even take this a step further in Tableau by creating sets for each of the four segments to use for deeper analysis later.

This post shares how to create a scatter plot in Tableau and use the results to create segments.

How to Make a Scatter Plot in Tableau

For this walk-through, we’ll be using the Sample – Superstore data set to evaluate all of our products across the Sales and Profit Ratio measures. When you build a scatter plot, one measure will form the Y-axis and one measure will form the X-axis. The marks on the view will then be plotted at the intersection of the values on the two axes.

To create a scatter plot, drag and drop the Profit Ratio measure to the Rows Shelf and the Sales measure to the Columns Shelf. Scatter plot is the default chart type in Tableau when two measures are used, so you could have got to this same point by just double-clicking Profit Ratio, then double-clicking Sales to add them to the view. At this point, your view should look similar to this:

How do you do a scatter plot in Tableau?

So far, we have just one point that represents the intersection of Profit Ratio and Sales for all of the records in our data set. This is because we have yet to specify a level of detail for our analysis. For more on this topic, you can review our fundamentals post: Tableau Marks Cards, Encoding, and Level of Detail. Our analysis is going to look at products, so change the level of detail by dragging the Product Name dimension to the Detail Marks Card. The view has now been changed to this:

How do you do a scatter plot in Tableau?

What’s powerful here is that we are looking at all 1,850 of our products at once, which helps us evaluate them quickly in context of each other. You can see outliers, unprofitable products, and segments are beginning to emerge (i.e. high sales / high profit ratio, high sales / low profit ratio, and so on). One way to make the segments more apparent is to add reference lines to each axis. Here’s what the view looks like when we add a reference line for the average of each axis by right-clicking on each axis and choosing “Add reference line”:

How do you do a scatter plot in Tableau?

These reference lines create four quadrants on the view that can be used to segment the data:

  • Top-left quadrant: High Profit Ratio & Low Sales
  • Top-right quadrant: High Profit Ratio & High Sales
  • Bottom-left quadrant: Low Profit Ratio & Low Sales
  • Bottom-right quadrant: Low Profit Ratio & High Sales

This provides some areas to focus on. For example, we don’t want to have high sales of products that are causing us to lose money. Also, are there opportunities to increase the sales of our most profitable items? This example created segments using the averages of each measure, but you can easily change the reference lines to the thresholds of your choice for segmentation.

Lastly, these segments or products of interest can be made more permanent by placing them into sets. In the above example, our two highest-selling products are also above average in profitability. Let’s put these two products into a “positive-outlier” set by selecting them on the view (either through multi-select or dragging a box around them), right-clicking, and choosing “Create set…”. Once in a set, these positive outliers can be highlighted in different visualizations, which can lead to valuable insights for the business.

By entering your email address, you consent to receive communications from Evolytics. You may unsubscribe at any time by clicking the unsubscribe link located at the bottom of any email. This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


As the name suggests, a scatter plot shows many points scattered in the Cartesian plane. It is created by plotting values of numerical variables as X and Y coordinates in the Cartesian plane. Tableau takes at least one measure in the Rows shelf and one measure in the Columns shelf to create a scatter plot. However, we can add dimension fields to the scatter plot which play a role in marking different colors for the already existing points in the scatter graph.

Simple Scatter Plot

Using the Sample-superstore, let's aim to find the variation of sales and profit figures as the two axes of the Cartesian plane is distributed according to their Sub-Category. To achieve this objective, following are the steps.

Step 1 − Drag and drop the measure Sales to the Columns shelf.

Step 2 − Drag and drop the measure Profit to the Rows shelf.

Step 3 − Pull the dimension Sub-Category to the labels Shelf under Marks.

The following chart appears which shows how profit and sales is distributed across the Sub-Category of products.

Scatter Plot - Color Encoded

You can get the values color encoded by dragging the dimension Sub-Category to the color Shelf under the Marks card. This chart shows the scatter points with different color for each point.

Drill-Down Scatter Plot

The same scatter plot can show different values when you choose a dimension with hierarchy. In the following example, we expand the Sub-Category field to show the scatter plot values for the Manufacturers.

This content is excerpted from my book, Innovative Tableau: 100 More Tips, Tutorials, and Strategies, published by O’Reilly Media Inc., 2020, ISBN: 978-1492075653. Get the book at Amazon.

When it comes to my favorite chart types, scatter plots are a close third behind bar charts and line graphs. In several industries, and especially scientific journals, scatter plots are the favorite choice because of their ability to reveal and communicate correlations. Another benefit of this chart type is it is one of the few visualizations that allow you to view many marks in a small space. No, you cannot analyze every individual mark because they will likely overlap, but scatter plots make it easy to identify outliers and the aforementioned correlations.

But wait – there’s more! Due to the way scatter plots are set up with a measure on each axis, adding reference lines for the average of each axis creates a natural four-quadrant segmentation. This is a great technique for isolating different groups so you can act on them individually.

This post will show you how to make scatter plots and take them to the next level in three ways. We’ll cover (1) a formatting trick to make your scatter plots stand out, (2) ideas for maximizing the data-ink ratio in the context of scatter plots, and (3) a calculated field that will automatically break your dimension members into four usable segments.

Related video tutorial:

How do you do a scatter plot in Tableau?

Premier Tableau eLearning from Playfair Data TV

How do you do a scatter plot in Tableau?

View / Interact / Download ›

How to make a scatter plot in Tableau

Scatter plots are created with two to four measures, and zero or more dimensions. The first two measures form the y-axis and x-axis; then the third and/or fourth measures as well as dimensions can be used to add context to the marks. For all three of the following tips, we will start with this default scatter plot comparing profit ratio and sales by sub-category in the Sample – Superstore dataset.

How do you do a scatter plot in Tableau?

This chart was built by putting my dependent measure of Profit Ratio on the Rows Shelf to form the y-axis, and my explanatory measure of Sales on the Columns Shelf to form the x-axis. I then put the Sub-Category dimension on the Detail Marks Card to make my analysis more granular and changed the mark type from Shape to Circle.

Scatter plot is the default chart type when starting with two measures, so I could have started this chart by simply double-clicking on the Profit Ratio measure from the Measures area of the Data pane and then double-clicking on the Sales measure from the Measures area of the Data pane. Since it is best practice to put the dependent measure on the Y-axis, and the explanatory measure on the X-axis, Tableau will place the first measure you double-click onto to the Rows Shelf and second measure you double-click on the Columns Shelf.

You can immediately see a correlation showing that as profit ratio increases, sales tend to decrease, but we’re going to keep building on this scatter plot to make it more engaging and functional.

Exercise – Make a Scatter Plot in Tableau

Tip 1 – A formatting trick for better mark borders

As mentioned in the introduction to this post, one of the benefits of scatter plots is that you can evaluate a lot of marks in a small space. However, this often creates overlapping marks. This is easy to alleviate by clicking on the Color Marks Card and reducing the opacity of the marks, but it doesn’t work great with mark borders. Borders are an effect on the Color Marks Card that I often like to add, but they do not inherit the opacity of the underlying mark and you can also only pick one color for all marks. The following trick allows you to control the marks and their borders independently, unlocking a great deal of formatting flexibility. To help demonstrate, I’ve added the Category dimension to the Color Marks Card of our default scatter plot and made the marks slightly larger.

How do you do a scatter plot in Tableau?

To format marks and their borders independently, place the dependent measure on the Rows Shelf next to itself a second time. This will create the same chart on two rows. Convert the two rows to a dual-axis scatter plot by clicking on the second occurrence of the measure on the Rows Shelf and clicking “Dual Axis”.

How do you do a scatter plot in Tableau?

Lastly, ensure the dual axes are synchronized by right-clicking on either y-axis and choosing “Synchronize Axis”. Both scatter plots are now laying right on top of each other. What’s important here is now that we’ve added a second measure to one of the shelves, they each have their own set of Marks Cards which can be edited independently of each other. This means we can do things like reduce the opacity of the original marks and change the mark type of the second set of marks to Circle.

Check it out – borders that match the color of the underlying mark!

How do you do a scatter plot in Tableau?

We obviously don’t need to see the second y-axis any more so you can hide that by right-clicking on it and deselecting “Show Header”.

A Formatting Trick for Tableau Scatter Plots and Maps

Tip 2 – Maximize the Data-Ink Ratio

Many of my tips for improving the design of Tableau dashboards are related to Edward Tufte’s “Data-Ink Ratio”. One of the tenets of the data-ink ratio is that you should remove redundant data, which in my opinion, often shows up in the form of too many axis tick marks. This is easy to clean up in Tableau by right-clicking on an axis, choosing “Edit Axis…”, and making the “Fixed” selections on the “Tick Marks” tab.

How do you do a scatter plot in Tableau?

Here’s how my scatter plot looks after fixing the tick marks of the y-axis at 10% increments and the x-axis at increments of $100,000.

How do you do a scatter plot in Tableau?

Beware that once you fix tick marks, they are truly fixed. This is okay for static charts or axis ranges that do not fluctuate much but can cause issues if the values on your axes vary widely.

In this case, fixing the tick marks improved the design of our chart, but with scatter plots, I like to take this concept a step further. First, I’ll remove all extra lines including borders and zero lines (optional depending on your analysis). You can do this by right-clicking any where on the chart, clicking “Format…”, and making your changes to the “Borders” and “Lines” tabs; these are the fourth and fifth icons at the top of the Formatting pane. Here’s how the scatter plot looks after changing the Row Dividers, Column Dividers, and Zero Lines to None.

How do you do a scatter plot in Tableau?

Lastly, I’ll change the Formatting of the Grid Lines so they are dotted and have a heavier weight. Here’s how my final view looks after making this change and putting the fonts in brand.

How do you do a scatter plot in Tableau?

Compare this version to the default scatter plot at the beginning of this post!

Tip 3 – Make the scatter plot functional with a segmentation calculated field

I mentioned in the post introduction that adding reference lines for the average of each axis creates a natural four-quadrant segmentation. Next, I will share a way to make that segmentation permanent through a calculated field. This will allow you to isolate the four segments so you can evaluate and act on them individually based on their behavior. To begin, I’ll add an average reference line to each axis by navigating to the Analytics pane (just to the right of the Data pane on the left) and dragging Average Line onto the view.

How do you do a scatter plot in Tableau?

Depending on the number of axes on the view, dragging Average Line from the Analytics pane to the view can be a little confusing. This is because you must choose both the axis and the scope of the reference line. If you prefer, you can also add reference lines by simply right-clicking on each axis and choosing “Add Reference Line”.

Notice we now have four quadrants on the view. The top-left corner are the sub-categories with a high profit ratio and low sales; the top-right are those with a high profit ratio and high sales; the bottom-right are those with a low profit ratio and high sales; the bottom-left are those with both a low profit ratio and low sales. Depending on the dimension members in your analysis, you very likely may want to act on these four groups in different ways.

To isolate each group, you could select the dimension members in each quadrant by dragging a box around them and creating sets. A better method would be to write a calculated field to match the four-quadrant segmentation being shown, then place the calculated field on the Color Marks Card. This has several advantages including (1) makes it apparent to you and your end users what segmentation you’re evaluating (2) guarantees you are placing the correct dimension members into the correct sets (which can be difficult if some dimension members are close to the reference lines), and (3) provides a means for filtering for easier set creation.

As always, there is more than one way to accomplish the same objective in Tableau, but I think the easiest approach in this use case is to create a calculated field using the WINDOW_AVG table calculation. Here’s the formula for our four-quadrant segmentation:

IF [Profit Ratio] > WINDOW_AVG([Profit Ratio]) AND SUM([Sales]) < WINDOW_AVG(SUM([Sales])) THEN “High Profit Ratio & Low Sales”

ELSEIF [Profit Ratio] > WINDOW_AVG([Profit Ratio]) AND SUM([Sales]) > WINDOW_AVG(SUM([Sales])) THEN “High Profit Ratio & High Sales”

ELSEIF [Profit Ratio] < WINDOW_AVG([Profit Ratio]) AND SUM([Sales]) > WINDOW_AVG(SUM([Sales])) THEN “Low Profit Ratio & High Sales”

ELSE “Low Profit Ratio & Low Sales”

END

How do you do a scatter plot in Tableau?

You could also use this calculation to parameterize the measures being used and/or give the segments aliases that are relevant to your business (i.e. rising stars, cash cows, dogs, etc.).

Once you’ve got the calculation, place it on the Color Marks Card.

How do you do a scatter plot in Tableau?

As you can see, so far all the marks have the same color. This is because, by default, table calculations (including WINDOW_AVG) are computed from left to right. We need to change the addressing of the table calculation from the default Table (across) to the level of detail we are segmenting: Sub-Category. This can be achieved by clicking on the measure with the delta symbol (Δ), hovering over “Compute Using”, and choosing “Sub-Category”.

How do you do a scatter plot in Tableau?

An Introduction to Tableau Table Calculations

Here’s how the view looks after changing the addressing and choosing colors for each of the four segments.

How do you do a scatter plot in Tableau?

In a real-world business context, we may want to handle these product segments differently. Remember this segmentation can be used with any dimension relevant to your business, so you may be segmenting different regions, marketing channels, or customers. From here, it is very easy to isolate a segment using just two additional steps.

Let’s say we see an opportunity to improve our bottom line by focusing on the High Profit Ratio & Low Sales segment. These sub-categories are not selling much, but they’re very profitable when we do sell them. Perhaps we can do a promotional campaign to drive sales to the highly profitable products, or maybe we just want to further evaluate what’s making them profitable versus the other low-selling segment.

First, filter the view by right-clicking on the segment of interest on the color legend and choosing “Keep Only”.

How do you do a scatter plot in Tableau?

This will leave only the segment of interest on the view. Next, drag a box around the marks, right-click any one of them, and choose “Create Set…”.

How do you do a scatter plot in Tableau?

After giving the set a name and clicking “OK”, you will have an isolated set of the dimension members in your segment over in the Sets area of the Data pane. For some ideas on using this, see An Introduction to Sets in Tableau.

Thanks for reading,
– Ryan