plt.plot(x) automatically groups your x values ββalong the y axis. To get the rotation, you have to plot your x values ββalong the x axis. So you need a to make a vector for the y axis, which is the same length as your sample.
import random import matplotlib.pyplot as plt import numpy as np x=random.sample(1000) y=np.arange(1000) plt.plot(x,y)
Using plt.plot(x) , matplotlib takes your x values ββas its y values ββand automatically creates a vector for the x axis.
source share