image                  package:spam                  R Documentation

_D_i_s_p_l_a_y _a _s_p_a_m _O_b_j_e_c_t _a_s _C_o_l_o_r _I_m_a_g_e

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

     The function creates a grid of colored rectangles with colors
     corresponding to the values in 'z'.

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

       image(x, ...)

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

       x: matrix of class 'spam' or 'spam.chol.NgPeyton'.

     ...: any other arguments passed to 'image.default' and 'plot'.

_D_e_t_a_i_l_s:

     'getOption('imagesize')' determines  if the sparse matrix is
     coerced into a matrix and the plotted similarly to 'image.default'
     or if the matrix is simply represented as a scatterplot with
     'pch="."'. The points are scaled according to
     'cex*spam.getOption('cex')/(nrow+ncol)'. For some devices or for
     non-square matrices, 'cex' needs probably some adjustment.
      The a zero matrix in 'spam' format has as (1,1) entry the value
     zero and only missing entries are interpreted as 'NA' in the
     scatter plot.

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

     Reinhard Furrer

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

     'display' and  'spam.options'.
      The code is based on  'image' of 'graphics'.

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

     set.seed(13)
     nz <- 8
     ln <- nz
     smat <- spam(0,ln,ln)
     smat[ cbind(sample(ln,nz),sample(ln,nz))] <- 1:nz

     par(mfcol=c(1,2),pty='s')
     spam.options( imagesize=1000)
     image(smat)#better: col=tim.colors(nz))
     spam.options( imagesize=10)
     image(smat)#better: col=tim.colors(nz))

     nz <- 128
     ln <- nz^2
     smat <- spam(0,ln,ln)
     smat[cbind(sample(ln,nz),sample(ln,nz))] <- 1:nz

     par(mfcol=c(1,1),pty='s')
     image(smat,cex=100)#better:, col=tim.colors(nz))

