是否可以绘制带有箭头的图形,如 MATLAB 中附加的图像所示?

问题描述

我可以在 Matlab 中绘制这样的图吗?如果不是,绘制它的正确软件是什么?稍后,我需要将图形粘贴到 MS word 文件中。

image

解决方法

当然,您需要注释功能,例如

figure('Color','w');
plot(-pi:0.01:pi,sin(-pi:0.01:pi));
ax=gca();
set(ax,'YAxisLocation','left','XAxisLocation','bottom','Box','off','XTick',[],'YTick',[])
annotation('textarrow',[0.4,0.5],'String','P')
annotation('arrow',[ax.Position(1),sum(ax.Position([1,3]))],ax.Position([2,2]),'LineWidth',0.5);
annotation('arrow',ax.Position([1,1]),[ax.Position(2),sum(ax.Position([2,4]))],0.5);
annotation('textbox',[ax.Position(1)-0.05,4]))-0.05,0.05,0.05],'Q','EdgeColor','none')
annotation('textbox',[sum(ax.Position([1,3]))-0.05,ax.Position(2)-0.05,'R','none')

enter image description here