2010-03-02 7 views
12

J'aime changer l'axe x avec l'axe y après avoir tracé un graphique avec matplotlib? Un moyen facile pour cela? Merci d'avance.Comment changer d'axe dans matplotlib?

+1

http://stackoverflow.com/questions/15767781/python-matplotlib-way-to-transpose-axes/15859177#15859177 nouveau duplicata de ce post – tacaswell

Répondre

-2

Vous pouvez tout simplement passer paramètres x et y dans la fonction du terrain:

I[3]: x = np.linspace(0,2*np.pi, 100) 

I[4]: y = np.sin(x) 

I[5]: plt.plot(x,y) 

I[6]: plt.figure(); plt.plot(y,x) 
+4

Merci, mais ce n'est pas la réponse que je cherche. Je demande comment changer les axes x et y après avoir tracé toutes les données. –

+0

@DaehyokShin, avez-vous trouvé la bonne façon de le faire? – has