Matlab中绘制带箭头的坐标轴

代码:

clear; %清除所有变量
close all; %清图
clc ;      %清屏

figure;
x=-5:10;
y=-5:10;
plot([0 0],[min(y),max(y)],'k',[min(x),max(x)],[0 0],'k');
%axis off
hold on
ax=[max(x),max(x)-0.3,max(x)-0.3;0,0.2,-0.2];
fill(ax(1,:),ax(2,:),'k');
ay=[0,0.15,-0.15;max(y),max(y)-0.4,max(y)-0.4];
fill(ay(1,:),ay(2,:),'k');

效果:
Matlab中绘制带箭头的坐标轴_第1张图片

你可能感兴趣的:(matlab,数学)