交换x& Matlab中的y轴 [英] Swapping x & y Axis in Matlab

查看:302
本文介绍了交换x& Matlab中的y轴的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里可能很容易出现matlab问题,但是我已经搜索过了,无法弄清楚该怎么做.

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:

我简单地希望x轴成为y轴,反之亦然.我该如何交换它们?

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

在此先感谢您的帮助!

推荐答案

标准方法是交换传递给plot的参数:

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])

这篇关于交换x& Matlab中的y轴的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆