lundi 13 juin 2016

Is there a View function in Python to rotate plots like in Matlab?


I have an image that I would like to rotate. Namely, exchange the x and y axes. It is of a spectrogram. The basic code is

import matplotlib.pyplot as plt

Sxx, f, t, im = plt.specgram(dataArray, NFFT=2**8, Fs = 100, noverlap = 128)

plt.show()

This is what gets produced:

enter image description here

Does Python have a function that rotates the image 90 degrees as easily as the View function does in Matlab?

UPDATE

I've learned that plt.specgram can take all kwargs that imshow does. I still couldn't find any that would rotate the image, though. Anyone know?


Aucun commentaire:

Enregistrer un commentaire