# Chapter 11 Grid aesthetics

The cell grid can be customized as you like in terms of color, size.

## 11.1 Removing the grid

Removing the grid lines is achieved by setting grid.hline = FALSE and grid.vline = FALSE.

set.seed(2016113)
superheat(mtcars,
# scale the matrix columns
scale = TRUE,
# remove the grid
grid.hline = FALSE,
grid.vline = FALSE)

## 11.2 Grid color

One particularly nice setting is to make the grid lines white. Changing the color can be done using grid.hline.col and grid.vline.col.

set.seed(2016113)
superheat(mtcars,
# scale the matrix columns
scale = TRUE,
# change the grid color
grid.hline.col = "white",
grid.vline.col = "white")

## 11.3 Grid size

The grid lines can be made thicker or thinner using the grid.hline.size and grid.vline.size arguments.

set.seed(2016113)
superheat(mtcars,
# scale the matrix columns
scale = TRUE,
# change the grid size
grid.hline.col = "white",
grid.vline.col = "white",
grid.hline.size = 2,
grid.vline.size = 2)

## 11.4 Clustered grid

When clustering the heatmap, the grid lines are placed around the clusters rather than the individual rows and columns. Specifically, this helps present the clusters when forcing the left and bottom labels to be the variable names.

set.seed(2016113)
superheat(mtcars,
# scale the matrix columns
scale = TRUE,

# cluster the heatmap
n.clusters.rows = 3,
left.label = "variable",
n.clusters.cols = 2,
bottom.label = "variable")