自定义 stem 函数,去除 stem 函数中的 0 位线,
不适合大数据量绘图
函数 m 文件及测试文件下载地址:
4. 测试程序
测试 1:带箭头属性绘图
clc
clear
x = linspace(0,10,1000);
y = sin(2*pi*0.1*x);
Attribute_Set = {'LineWidth',1.5}; % 箭头属性及其取值,设置箭头宽度为 1.5
[h h_a h_p h_arrow] = plot_with_arrow( [],x,y,'k',[],[],Attribute_Set ); % 绘图
htext_x = Arrow_Xlabel([],'时间/s',[]); % x 轴标签
htext_y = Arrow_Ylabel([],'幅值/V',[]); % y 轴标签
htext_title = Arrow_Title([],'图形 Test'); % 图形标题
测试 2:用数值指示箭头坐标轴位置
clc
clear
x = linspace(0,10,1000);
y = sin(2*pi*0.1*x);
figure
ha1 = subplot(211); % 获取坐标轴句柄
pos = [0.1 0.7 1 1 0.1 0.7]; % 坐标轴位置
[h h_a h_p h_arrow] = plot_with_arrow( ha1,x,y,'k',pos ); % 直接输入坐标轴位置,暂不支持箭头坐标轴位置
评论0