Swapping x & y Axis in Matlab

感情迁移 提交于 2019-12-10 16:44:35

问题


Potentially easy matlab question here, but I've searched and can't sort out how to do this.

I've got a variables, which plot like this:

I simple want the x axis to be the y axis and vice versa. How do I swap them?

Thank you in advance for your help!!


回答1:


The standard way would be to swap the arguments passed to plot:

plot(ydata, xdata) %// instead of plot(xdata, ydata)

Failing that, you can change the view to rotate the axes:

view([90 -90]) %// instead of normal view, which is view([0 90])


来源:https://stackoverflow.com/questions/29784601/swapping-x-y-axis-in-matlab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!