马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?我要加入
x
来自: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)
复制代码
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.
Not satisfied? Neither was Shanrong. Hence, PlotAxisAtOrigin.
代码:
hline.m
(3.03 KB, 下载次数: 57)
vline.m
(2.97 KB, 下载次数: 47)
PlotAxisAtOrigin.m
(1003 Bytes, 下载次数: 86)
|