Sebastian De Pascuale
Sebastian De Pascuale

Reputation: 391

Rotating an image array in Numpy

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?

Thanks for your time

Upvotes: 8

Views: 12866

Answers (2)

Luke
Luke

Reputation: 11644

How about scipy.ndimage.interpolation.rotate()?

Upvotes: 7

acm
acm

Reputation: 12727

You should be able to use rot90 on the array to rotate it and then imshow.

Upvotes: 6

Related Questions