Why does the image() function not work properly?

后端 未结 2 1346
不知归路
不知归路 2021-01-17 07:05

I have big binary matrix (0,1) and I want to visualize it so that every entry of my matrix is one pixel in the plot. I use the image() function, but it does not

2条回答
  •  逝去的感伤
    2021-01-17 08:00

    I dnt know about the image() function, but you can do this with EBImage package like this.

    a<-list(c(0,1,1,0),c(1,1,0,0))
    b<-matrix(unlist(a),ncol=2)
    library(EBImage)
    x <- as.Image(b)
    display(x,method='raster')
    

提交回复
热议问题