plotcolors               package:gclus               R Documentation

_P_l_o_t_s _a _m_a_t_r_i_x _o_f _c_o_l_o_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     'plotcolors' plots a matrix of colors  as an image or as points.

     'imageinfo' is a utility that given a matrix of colors, returns a
     structure useful for the 'image' function.

_U_s_a_g_e:

     plotcolors(cmat, na.color = "white", dlabels = NULL, rlabels = FALSE, clabels = FALSE, 
     ptype = "image", border.color = "grey70", pch = 15, cex = 3, label.cex = 0.6, ...)

     imageinfo(cmat)

_A_r_g_u_m_e_n_t_s:

    cmat: a matrix of numbers, nas are allowed.

na.color: used for NAs in 'cmat'.

 dlabels: vector of labels for the diagonals.

 rlabels: vector of labels for the rows.

 clabels: vector of labels for the columns.

   ptype: should be "image" or "points"

border.color: color of border drawn around the plot.

     pch: point type used when ptype="points".

     cex: point cex used when ptype="points".

label.cex: cex parameter used for labels.

     ...: graphical parameters

_V_a_l_u_e:

     'imageinfo' returns a list with components: 

       x: a vector of x coordinates.

       y: a vector of y coordinates.

       z: a matrix containing values to be plotted.

     col: the colors to be used.

_A_u_t_h_o_r(_s):

     Catherine B. Hurley

_S_e_e _A_l_s_o:

     'plot', 'image'

_E_x_a_m_p_l_e_s:

     plotcolors(matrix(1:20,nrow=4,ncol=5))

     plotcolors(matrix(1:20,nrow=4,ncol=5),ptype="points",cex=6)

     plotcolors(matrix(1:20,nrow=4,ncol=5),rlabels = c("a","b","c","d"))

     data(longley)
     longley.cor <- cor(longley)
     # A matrix with equal (or nearly equal) number of entries of each color.
     longley.color <- dmat.color(longley.cor)

     plotcolors(longley.color, dlabels=rownames(longley.color))

     # Could also reorder variables prior to plotting:
     longley.o <- order.single(longley.cor)
     longley.color <- longley.color[longley.o,longley.o]

     op <- par(mar=c(1,6,6,1))
     plotcolors(longley.color,rlabels=rownames(longley.color),clabels=rownames(longley.color) )
     par(op)

