I have a 2D array that represents the values of an image that can be viewed with the imshow() command in matplotlib. I would like to rotate the values of this array ("Rotate the image") and have not found a way to do so with a typical NxN array. Anyone know how to do this?
我有一个2D数组,表示可以使用matplotlib中的imshow()命令查看的图像的值。我想旋转这个数组的值(“旋转图像”),并没有找到一种方法来使用典型的NxN数组。有人知道怎么做吗?
Thanks for your time
谢谢你的时间
2 个解决方案
#2
6
You should be able to use rot90 on the array to rotate it and then imshow.
您应该能够在阵列上使用rot90来旋转它,然后进行imshow。
#1
#2
6
You should be able to use rot90 on the array to rotate it and then imshow.
您应该能够在阵列上使用rot90来旋转它,然后进行imshow。