cmat: A matrix of valid colours, with missing values coded as NA allowed. Vectors should be supplied as matrices with 1 row or column, as appropriate.
na.col: Colour used for missing NA entries in cmat.
ptype: Switch controlling output as either a heat map "image" (the default) or as "points".
border.col: Colour of border drawn around the plot.
dlabels, rlabels, clabels: Vector of labels for the diagonals, rows, and columns, respectively.
pch: Point type used when ptype="points".
cex: Point cex used when ptype="points".
label.cex: Govens cex parameter used for labels.
...: Further graphical parameters.
Returns
Either an "image" or "points" type plot of the supplied colours.
Examples
# Generate a colour matrix using mat2cols()mat <- matrix(rnorm(100), nrow=10, ncol=10)mat[2,3]<-NAcols <- heat.colors(12)[12:1](matcol <- mat2cols(mat, cols=cols))# Use plot_cols() to visualise the colours matrixpar(mar=c(5.1,4.1,4.1,3.1))plot_cols(matcol)# Add a legend using heat_legend()heat_legend(mat, cols=cols); box(lwd=2)# Replace colour of exact zero entries:# Often important to call mat2cols() first (to include 0 in the cuts),# then replace relevant entries with NA for plot_cols(), i.e.mat[2,3]<-0matcol2 <- mat2cols(mat, cols=cols)plot_cols(replace(matcol2, mat ==0,NA), na.col="blue")heat_legend(mat, cols=cols); box(lwd=2)