Simplest possible heatmap with ggplot2
Featuring the lovely “spectral” palette from Colorbrewer. This really just serves as a reminder of how to do four things I frequently want to do:
- Make a heatmap of some kind of matrix, often a square correlation matrix
- Reorder a factor variable, as displayed along the axis of a plot
- Define my own color palette with colorRampPalette()
- Use RColorBrewer, specifically the diverging “spectral” scheme
