简体   繁体   English

是否可以 plot 一个带有箭头的图形,如 MATLAB 中所附的图像所示?

[英]Is it possible to plot a figure with arrows as shown in image attached in MATLAB?

Can I draw such a plot in Matlab?我可以在Matlab中画出这样的plot吗? If not what would be the right software to draw it?如果不是,什么是正确的软件来绘制它? Later, I need to paste figure in MS word file.稍后,我需要将图形粘贴到 MS word 文件中。

图片

Sure, you need the annotation function, eg当然,您需要注释function,例如

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],[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]))],'LineWidth',0.5);
annotation('textbox',[ax.Position(1)-0.05,sum(ax.Position([2,4]))-0.05,0.05,0.05],'String','Q','EdgeColor','none')
annotation('textbox',[sum(ax.Position([1,3]))-0.05,ax.Position(2)-0.05,0.05,0.05],'String','R','EdgeColor','none')

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM