# NOT RUN {
# Generate a colour matrix using mat2cols()
mat <- matrix(rnorm(100), nrow=10, ncol=10)
mat[2,3] <- NA
cols <- heat.colors(12)[12:1]
matcol <- mat2cols(mat, cols=cols)
matcol
# Use plot_cols() to visualise the colours matrix
par(mar=c(5.1, 4.1, 4.1, 4.1))
plot_cols(matcol)
# Add a legend using heat_legend()
heat_legend(mat, cols=cols); box(lwd=2)
# }
Run the code above in your browser using DataLab