声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 2015|回复: 0

[编程技巧] 如何在MatLab中画带箭头的坐标系?

[复制链接]
发表于 2016-5-17 09:37 | 显示全部楼层 |阅读模式

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

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

x
%%
clear;
close all;

%%
u = 1;
v = 2;
x=-3:3;
y=u * x + v;
figure; plot(x,y,'LineWidth',1.5);
hold on;

%Draw axes
plot([0 0],[min(y)-1 max(y)+1],'k',[min(x)-1 max(x)+1],[0 0],'k');

% Draw arrows
ax=[max(x)+1,max(x)+1-0.3,max(x)+1-0.3; 0,0.12,-0.12];
fill(ax(1,:),ax(2,:),'k');
ay=[0,0.08,-0.08; max(y)+1,max(y)+1-0.4,max(y)+1-0.4];
fill(ay(1,:),ay(2,:),'k');

%%
text(0.2, 5.6, 'y', 'FontName','Times New Roman','FontAngle','Italic','FontSize',18, 'HorizontalAlignment','left')
text(3.6, -0.1, 'x','FontName','Times New Roman','FontAngle','Italic','FontSize',18, 'VerticalAlignment','top')
axis off
print('-djpeg', 'Oxy.jpg')

转自:http://blog.sina.com.cn/s/blog_82b526270101e3fb.html

本帖被以下淘专辑推荐:

回复
分享到:

使用道具 举报

您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

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

GMT+8, 2024-4-25 23:21 , Processed in 0.092874 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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