Say, I have a feature vector vec, which is actually a picture (stretched). To show it, I am using the solution from this post: image(matrix(vec,nrow=height,ncol=width),axes = FALSE,col = grey(seq(0, 1, length = 256))), but because the origin is at the bottom left corner so the picture is rotated 90°. I think I can move the origin too but R should have a function like imshow in MATLAB which is more appropriate and direct for showing a picture without the need of configuring so much, while image() is for visualizing a matrix. So, is there such a function? Thank you.
Say, I have a feature vector vec , which is actually a picture (stretched).
Share
Transposing your matrix by
t()is the solution:Or to flip it: