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))
Run the code above in your browser using DataLab