请问如何绘制下图:导入自定义的形状图形,并旋转特定的角度。
在MATLAB或ORIGIN上可以实现吗?
谢谢!
你好,自定义形状,好比说:
clc;clear
ratio = 10;
marker = ratio*[
-10,-2;
5,-2;
10,0;
5,2;
-10,2
]; % 自己定义的形状
x = -1600:20:1000; % 线
y = 150./(1-exp((x+2000)/6000))+2000;
plot(x,y,'r-','linewidth',1)
axis equal
xm = -1600:200:1000; % marker的点x坐标
ym = 150./(1-exp((xm+2000)/6000))+2000;% marker的点y坐标
theta = linspace(0,pi/2,numel(xm)); theta = theta(end:-1:1);% 转角向量
T = arrayfun(@(i)[cos(theta(i)),-sin(theta(i)); sin(theta(i)), cos(theta(i))],...
1:numel(theta),'uniform',0); % 旋转矩阵
arrayfun(@(i) patch('vertices',[xm(i),ym(i)]+marker*T{i}','faces',1:size(marker,1),'facecolor','n','edgecolor','b'),...
1:numel(theta));
然后就可以得到如下效果: