matlib二维图形绘制

subplot(2,4,1)
t=[3,10 20 5]
explode1 = [0 0 0 1] %将1对应的部分分离
explode2 = [0 1 1 0]
pie(t,explode2)

subplot(2,4,2)
x=0:1:10;
y=exp(x);
bar(x,y) %绘制柱形图
axis()
subplot(2,4,3)
compass([5+5i,10-5i]) %绘制向量图

subplot(2,4,4)
fill(x,y,'g');

subplot(2,4,5)
stem(x,y)

subplot(2,4,6)
area(x,y)

subplot(2,4,7)
stairs(x,y)

subplot(2,4,8)
%在3 5 处创建宽15长8 的圆角矩形
rectangle('Position',[3,5,15,8],'Curvature',0.4,'LineWidth',2)
axis();

原文地址:https://www.cnblogs.com/ahaoboy/p/5927757.html