问题
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