Change axis in mapltolib figure
<p>Usually matplotlib uses this axis:</p>

<pre><code>Y
|
|
|_______X
</code></pre>

<p>But I need to plot my data using:</p>

<pre><code>  _________Y
 |
 |
 |
 X
</code></pre>

<p>How can I do it? I will prefer not modify my data (i.e. transposing). I need to be able of use the coordinates always and matplotlib changes the axis.</p>

<p>One of the variations:</p>

<pre><code>import matplotlib.pyplot as plt

def Scatter(x, y):        
    ax.scatter(y, x) 

#Data preparation part:
x=[1, 2, 3, 4, 5]
y=[2, 3, 4, 5, 6]  

#Plotting and axis inverting part
fig, ax = plt.subplots(figsize=(10,8))
plt.ylabel('X', fontsize=15)
plt.xlabel('Y', fontsize=15)

ax.xaxis.set_label_position('top') #This send label to top 
plt.gca().invert_yaxis() #This inverts y axis
ax.xaxis.tick_top() #This send xticks to top

#User defined function Scatter
Scatter(x,y)

ax.grid()
ax.axis('scaled') 
plt.show()
</code></pre>

<p><strong>Output:</strong></p>

<p><a href="http://i.stack.imgur.com/xnPty.jpg" rel="nofollow"><img src="http://i.stack.imgur.com/xnPty.jpg" alt="enter image description here"></a></p>

python numpy matplotlib axis