This example illustrates the code behind the scores_heatmap() pre-built view function. If you want to include this plot in your notebooks or websites you should start with that function rather than the lower-level code below.
The cell mark draws the cells, position each cell along the x and y axis using the fields specified in x and y.
2
The cell’s color is determined using the field specified in the fill.
3
The cell inset controls the space between cells.
4
Sorting of the cells is important in a heatmap to cause colors to be grouped along the x and y axis. In this case, we sort using the sum of the rows and columns, place the highest values at the top righ and lowest values at the bottom left.
5
Place the value as text centered in the cell.
6
Remove plot padding so the inset along controls spacing between cells.