A matrix can be converted into a pixel’s image of matrix. It is defined as the area of the matrix which contains pixels with equal or different sizes of left, right, bottom and upper.
We can create this by using image function and its argument useRaster with the matrix data.
Example
> M<-matrix(rnorm(100,1.5),nrow=10) > par(mar=c(5,5,5,5)) > image(M,useRaster=TRUE,axes=FALSE)
Output
> par(mar=c(10,10,10,10)) > image(M,useRaster=TRUE,axes=FALSE)
Output
> par(mar=c(2,2,2,2)) > image(M,useRaster=TRUE,axes=FALSE)
Output
Pixel matrix with grey color −
> image(M,axes=FALSE,col=grey(seq(0,1,length=180)))