Reputation: 329
I have the next stem plot
plt.stem(m)
and I want it but 90 degrees clockwise rotated. I've tried with
plt.stem(m,np.arange(m.size))
And obtain the next plot
The expecting result it's something like the R(t) of the next image: https://subsurfwiki.org/images/4/43/Convolutional_model.png
Upvotes: 0
Views: 718
Reputation: 4695
With matplotlib>= 3.4.0 (release notes here), you can specify orientation='horizontal'
in the stem
function (see doc here):
Example below from the doc:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0.1, 2 * np.pi, 41)
y = np.exp(np.sin(x))
plt.stem(x,y, orientation='horizontal')
plt.show()
and:
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0.1, 2 * np.pi, 41)
y = np.exp(np.sin(x))
plt.stem(x,y, orientation='vertical')
plt.show()
Upvotes: 1