如何在MatLab中画带箭头的坐…
2016-05-23 10:34
411 查看
原文地址:如何在MatLab中画带箭头的坐标系作者:Owenseng如何在MatLab中画带箭头的坐标系
%%画线然后填充
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')
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/lionxiao/archive/2009/08/16/4453532.aspx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
来源:http://zhidao.baidu.com/question/71952214.html
%%画线然后填充
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')
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/lionxiao/archive/2009/08/16/4453532.aspx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
annotation('doublearrow',[0.2 0.3],[0.5 0.6]) 可以画坐标在0-1之间的箭头 要画任意的箭头,在 http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=8396&objectType=FILE# 点击里面的Download Now:zip下载文件把解压后的arrow.m放入matlab当前路径,直接调用arrow函数即可
来源:http://zhidao.baidu.com/question/71952214.html
相关文章推荐
- Matlab fmincon函数用法
- MATLAB中cell数组的全面介绍
- matlab的cat函数
- MATLAB排序函数
- matlab定时器代码解析
- Matlab画图函数与参数
- 单幅图像的深度学习,对NYU数据集进行划分
- Matlab中FFT快速傅里叶变换函数的应用及其物理意义学习
- LIBSVM在matlab下的使用安装
- Non Local Means-块匹配MATLAB和GPU实现
- Matlab的高斯输入的PID仿真
- 卷积编码的原理与MATLAB及FPGA实现
- SIFT算法的Matlab实现
- Matlab绘图高级部分
- matlab读取写入txt,excel文件
- Xilinx FPGA中RS编码IP核之Generator Start
- MATLAB图形用户界面的一个实例(2)
- MATLAB求解24点(抱歉,只会穷举)
- 一个简单求和函数的matlab实现(带程序耗时功能)
- matlab和C混合编程实现脉冲压缩