16443 发表于 2009-3-26 09:00

PlotAxisAtOrigin

来自:http://blogs.mathworks.com
As an application engineer I showed MATLAB to a lot of people. Occasionally when I presented graphics capabilities someone would ask how to make plots where the X and Y axes lines go through the origin. You know: the way we learned to draw them in school. By default MATLAB puts the X axes on bottom and the Y axes on the left.x = -2*pi:pi/10:2*pi;
y = sin(x);
plot(x,y)http://blogs.mathworks.com/images/pick/plot_axis_at_origin_01.png
While the xAxisLocation can be set to top, and the yAxisLocation can be right, neither has an origin option for example. So, instead, I usually suggested drawing lines through the origin. In fact, prior "Pick of the Week" star Brandon Kuczenski made that trivial with hline and vline.hline(0)
vline(0)http://blogs.mathworks.com/images/pick/plot_axis_at_origin_02.png
Not satisfied? Neither was Shanrong. Hence, PlotAxisAtOrigin.PlotAxisAtOrigin(x,y)http://blogs.mathworks.com/images/pick/plot_axis_at_origin_03.png

代码:

ChaChing 发表于 2009-3-26 18:53

第一时间感觉似成相识, 刚刚有空找了下, 原来在官网!
而且本版亦多次讨论过, 可能楼主没见到! 还是感谢楼主的热心!

http://www.mathworks.com/matlabcentral/fileexchange/10473
如何改变坐标轴的位置?
http://forum.vibunion.com/forum/viewthread.php?tid=70217&highlight=%D7%F8%B1%EA%D6%E1
请问matlab画二维图时,是否可以显示坐标轴的箭头?
http://forum.vibunion.com/forum/viewthread.php?tid=23755&highlight=%D7%F8%B1%EA%D6%E1

16443 发表于 2009-3-27 08:30

在这里没看见过,呵呵。而且我帖子已经注明出处了。
由于作图需要在官网找到,顺便就贴出来了。为了大家方便。

ChaChing 发表于 2009-3-27 15:09

回复 板凳 16443 的帖子

LZ别误会! 我有看到注明出处, 这是非常负责的态度, 钦佩!
借宝地列出连接主要是希望有一完整性

16443 发表于 2009-3-27 19:26

我没什么误会的,呵呵。
您多心了。

shijuyi 发表于 2011-3-4 15:23

谢谢,但是就是看不了啊

zhouyang664 发表于 2011-3-4 21:33

回复 6 # shijuyi 的帖子

什么叫“看不了”?

beidouhuoyun 发表于 2011-6-24 10:35

感谢楼主,好东西

pangsaai 发表于 2012-1-6 15:10

thx for sharing

blue2012 发表于 2013-1-10 15:03

谢谢分享 对我很有用
页: [1]
查看完整版本: PlotAxisAtOrigin