How to plot the following matrix
> a<-matrix(c(-1,0,1,0),nrow=2,ncol=2,byrow=TRUE)
> a
[,1] [,2]
[1,] -1 0
[2,] 1 0
as-is, i.e. in 2D, representing values in some palette, like grayscale?
Should get something like this:
while with
image(a,col=grey(seq(0, 1, length = 256)))
I am getting this:
i.e. matrix is reoriented and rescaled.