声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 4854|回复: 3

[编程技巧] axis equal和DataAspectRatio的区别?

[复制链接]
发表于 2009-9-15 17:11 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
axis equal是将定标因子设成相等,和set(gca,'DataAspectRatio', [1 1 1])这一句相比,有什么区别吗?
我自己试了下:t=0:0.1:6;plot(t,sin(t)+tan(t))
                        axis equal
如下面的左图,
t=0:0.1:6;plot(t,sin(t)+tan(t))
>> set(gca,'DataAspectRatio', [1 1 1])
结果如下面右图

[ 本帖最后由 cc2005726 于 2009-9-15 17:12 编辑 ]
1111111111111.JPG
回复
分享到:

使用道具 举报

发表于 2009-9-16 00:49 | 显示全部楼层
楼主不是试出来了吗!?
 楼主| 发表于 2009-9-16 09:25 | 显示全部楼层

回复 沙发 ChaChing 的帖子

呵呵,咋天就是觉得自己没看出什么区别,但不能确定所以发帖问下子。
今天有一个新的想法:
    axis equal这一句没有改变DataAspectRatioMode的默认属性:auto,所以MATLAB stretches the axes to fill the axes position rectangle (the rectangle defined by the last two elements in the Position property). This results in graphs that use the available space in the rectangle
   set(gca,'DataAspectRatio', [1 1 1])这一句实际上已经把'DataAspectRatioMode设成了manual,所以整个坐标系的范围就变小了

[ 本帖最后由 cc2005726 于 2009-9-16 10:56 编辑 ]

评分

1

查看全部评分

发表于 2010-10-1 14:56 | 显示全部楼层
顶顶
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-21 22:20 , Processed in 0.064097 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表