Exchange the x axis for the y axis in python
<p>I have a python code that read several files and returns the next plot:</p>

<p><a href="https://i.stack.imgur.com/S5p6o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/S5p6o.png" alt="plot"></a></p>

<p>Now I want to visualize it exchanging the x axis by the y axis. I know that I can do this in matplotlib just putting <code>plt.plot(y,x)</code> instead of <code>plt.plot(x,y)</code>, but I have 8 different plots in the figure, so changing everything one by one could be annoying if the number of plots rises: 
Is there a way to change the axis before show the image?</p>

<p>Here is part of the code:</p>

<pre><code>plt.figure(figsize=(14,8))

plt.plot(Ks_d001,std_d001,'k.',ms=2)#,label='all population')
plt.plot(Ks_d002,std_d002,'k.',ms=2)

KS = np.concatenate([Ks_d001,Ks_d002])
STD = np.concatenate([std_d001,std_d002])

grid = np.linspace(11.5,max(KS),50)
k0 = smooth.NonParamRegression(KS, STD, method=npr_methods.SpatialAverage())
k0.fit()       

plt.plot(grid, k0(grid), label="non-param. fit", color='red', linewidth=2)

plt.plot(Ks_Eta_d001,std_Eta_d001,'s',ms=10,color='green',label='Eta d001')
plt.plot(Ks_Eta_d002,std_Eta_d002,'s',ms=10,color='blue',label='Eta d002')

plt.plot(Ks_IP_d001,std_IP_d001,'p',ms=10,color='cyan',label='IP d001')
plt.plot(Ks_IP_d002,std_IP_d002,'p',ms=10,color='orange',label='IP d002')

plt.plot(Ks_GLS_d001,std_GLS_d001,'h',ms=10,color='red',label='GLS d001')
plt.plot(Ks_GLS_d002,std_GLS_d002,'h',ms=10,color='yellow',label='GLS d002')
</code></pre>