Skip to content
Tutorials Center
My learning

Topics

Lesson 9 of 35 ยท Building Views

Tableau Histogram, Box Plot, Scatter Plot, Heat Map and Bins

Show spread and relationships in Tableau: build histograms with bins, cumulative histograms, box plots, scatter plots, heat maps and circle views, with runnable numeric stand-ins.

Totals hide spread. Two products can both sell 1,000 units, one steadily and one in a single lucky week. Distribution charts reveal that: histograms show how values are spread, box plots summarize the spread compactly, scatter plots show how two measures relate, and heat maps color a grid by value.

As in earlier lessons, Tableau is described step by step, and each section includes a runnable Python stand-in with fixed random seeds, so the numbers are repeatable. The stand-ins are not Tableau; they show what the chart summarizes.

Histogram and bins

A histogram counts how many rows fall into each bin, an equal-width range of a measure. In Tableau the bin is a dimension created from a measure.

Steps:

  1. Click a measure in the Data pane (for example Sales) and choose Show Me > Histogram. Tableau creates a field Sales (bin) with an automatic bin size and puts COUNT(Orders) on Rows.
  2. To change the bin width, right-click Sales (bin) in the Data pane > Edit... and type a Size of bins (for example 100). You can click Suggest Bin Size for Tableau's rule of thumb.
  3. The bin is continuous, so the axis is a number line; the bars touch each other, which is the visual language of histograms.

Bin width changes the story. Too wide hides structure; too narrow makes noise. Try two or three sizes before you decide.

You can also make a bin with a calculation, which allows bins of unequal width or a rounding rule:

TEXT
FLOOR([Sales] / 100) * 100       // lower edge of a 100-wide bin

Try it: bins by hand (stand-in)

Python Stand-in: counting rows per bin

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The wide bins (300) smooth the shape; the narrow ones (100) show where most orders cluster. Real order values usually look like this: many small orders and a long tail.

Cumulative histogram

A cumulative histogram adds each bin to the previous one, so the last bar equals the total. It answers "what share of orders are below $X?".

  1. Build the histogram above.
  2. Right-click COUNT(Orders) on Rows > Quick Table Calculation > Running Total.
  3. Optionally change the mark type to Area, and apply Percent of Total with a second table calculation (right-click > Add Table Calculation) to see a percentage.
Python Stand-in: running total of bin counts

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Box plot

A box-and-whisker plot summarizes a distribution with five numbers: the median (line), the first and third quartiles (the box edges) and the whiskers. Points beyond the whiskers can be shown as outliers.

Steps:

  1. Put a dimension that defines the groups (Category) on Columns.
  2. Put the measure (Sales) on Rows, and make sure it is not aggregated: use Analysis > Aggregate Measures to turn it off, or put Order ID on Detail so each order is a mark.
  3. Choose Show Me > box-and-whisker plot. Tableau adds a Distribution reference line of type Box Plot to the axis.
  4. Right-click the axis > Edit Reference Line to set the whisker length: the extent of the data or a multiple of the inter-quartile range (IQR), commonly 1.5.

The detail field matters: the marks are the data points the box summarizes. If you leave the measure aggregated with no detail, there is only one mark per group and the box collapses.

Python Stand-in: quartiles, IQR and outliers

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The 2,600 order sits beyond the upper fence, so the plot would draw it as a separate dot. Tableau's quartiles use interpolation, as pandas does here, so values match the usual definition.

Scatter plot

A scatter plot places each mark by two measures to reveal relationships, clusters and outliers.

  1. Drag one measure (Sales) to Columns and another (Profit) to Rows.
  2. A single mark appears because both are aggregated. Drag a dimension such as Order ID or Customer Name to Detail to get one mark per entity, or turn off aggregation.
  3. Put a dimension on Color to split groups and a measure such as Quantity on Size for a third variable (this variant is the bubble chart).
  4. From the Analytics pane, drag Trend Line onto the plot to see the direction and R-squared. Trend lines and forecasts are covered in the advanced analytics chapter.
Python Stand-in: how strongly do two measures move together?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Correlation measures a straight-line relationship only. A scatter plot catches curves, clusters and outliers that a single number misses, which is why you plot first.

Heat map and highlight table

A heat map is a grid of two dimensions where each cell's color (or size) shows a measure.

  1. Put Category on Rows and Region on Columns.
  2. Put SUM(Sales) on Color.
  3. Change the mark type to Square and, optionally, put SUM(Sales) on Label.

Diverging colors (Edit Colors > Diverging) work well when the measure has a meaningful center such as zero profit. A highlight table is the same grid with a text mark that is colored; we use it again in Crosstabs and special charts.

Python Stand-in: the grid behind a heat map

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The empty cells (0 here, blank in Tableau) matter: a heat map shows both patterns and gaps.

Circle views

Change the mark type to Circle on a discrete-by-discrete view (a circle view) and each circle's size can show a measure. It is a compact alternative to a table, good for comparing many categories at once.

Common mistakes

  • No detail field in a scatter or box plot, so everything collapses into one mark.
  • One bin size accepted without trying alternatives.
  • Reading correlation as cause.
  • Using color alone for important values in a heat map; add labels.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. In Tableau, what is a bin?

    Bins turn a measure into a discrete or continuous dimension of ranges, which is what a histogram counts.
  2. 2. Your box plot shows one tiny box per category. What is missing?

    Box plots summarize individual marks. Without detail each category has one aggregated mark.
  3. 3. Which Quick Table Calculation turns a histogram into a cumulative histogram?

    Running Total adds each bin's count to the previous ones.
  4. 4. Which values does a box plot box show?

    The box spans Q1 to Q3, so it holds the middle half of the data, and a line marks the median.

Summary

  • A histogram counts rows per bin; try several bin sizes. Add Running Total for a cumulative histogram.
  • A box plot needs one mark per data point (a detail field) and shows median, quartiles and whiskers.
  • A scatter plot needs detail to avoid collapsing; add Color and Size for more variables.
  • A heat map uses Square marks colored by a measure on a two-dimension grid.

Next: Part-to-whole charts: pie, treemap, bubble, funnel and waterfall