首页 > 代码库 > 【matlab】在图中插入矩形(框or阴影)

【matlab】在图中插入矩形(框or阴影)

1. rectangle

rectangle(‘Position‘,[100,300,70,50],‘Curvature‘,[0,0],‘LineWidth‘,2,‘LineStyle‘,‘--‘,‘EdgeColor‘,‘r‘)

% rectangle(‘Position‘,[x,y,,],‘Curvature‘,[x曲率,y曲率],‘LineWidth‘,线宽,‘LineStyle‘,‘线型‘,‘EdgeColor‘,‘线色‘)

 

2. patch

H_pa = patch([0.02,0.02,2,2],[0.01, 10,10,0.01],[.8 .8 .8]);

% patch([Xleft, Xleft, Xright, Xright], [Ydown, Yup, Yup, Ydown],[阴影颜色]);

set(H_pa,‘EdgeColor‘,[.8 .8 .8],‘EdgeAlpha‘,0.5,‘FaceAlpha‘,0.5)

%set(H_pa,‘EdgeColor‘,[边框颜色],‘EdgeAlpha‘,边框透明度,‘FaceAlpha‘,阴影透明度)

 

【matlab】在图中插入矩形(框or阴影)