How do I add arrows in evolution analysis figure?

%Hello. Recently I've been working on an evolutionary game theory related problem where I need to draw a figure. I have found the code that shows what I need but unfortunately I can not find ways to add arrows in the graph. I need to add arrow in these 3 line graphs that will show the direction.
Also, I need kind suggestion on how I can improve the image quality in MATLAB? The default image output is disappointing.
function dxdt=differentialt(t,x,n,N,N2,P,f1,R,a,C,f2,V)
dxdt=[x(1)*(1-x(1))*(x(2)*(n*N-N2+P*f1)+V*f1-R*f1-a*C);x(2)*(1-x(2))*(x(1)*(N-n*N-N2+P*f2)-R*f2-(1-a)*C+V*f2)];
end
n=0.5;N=100;N2=40;a=0.5;C=40;V=50;R=20;P=10;f1=0.5;f2=0.5;
[T,Y]=ode45(@(t,x)differentialt(t,x,n,N,N2,P,f1,R,a,C,f2,V),[0 10],[0.5 0.5]);
subplot(3,1,1);
plot(T,Y(:,1));
subplot(3,1,2);
plot(T,Y(:,2))
subplot(3,1,3);
plot(Y(:,1),Y(:,2))
xlim([0 1]);
ylim([0 1]);

답변 (1개)

Walter Roberson
Walter Roberson 2024년 11월 15일

0 개 추천

You can use annotation 'arrow'. Unfortunately by itself annotation() uses Normalized coordinates -- normalized relative to the figure, and none of the Units options permit data units.
https://www.mathworks.com/matlabcentral/answers/310815-specify-annotation-position-with-respect-to-x-and-y-axes-values#answer_635749 describes how to re-parent annotation to axes; when you do that then you can use data units.
The post also describes using coord2norm() file exchange contribution, which helps covert data coordinates to normalized coordinates.

댓글 수: 1

MD
MD 2024년 11월 16일
Hello. Thanks for responding fast.
Unfortunately this is not what I am looking for. Is there any way to add arrow like this image? I mean, make the line with an arrow.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

제품

릴리스

R2024a

질문:

MD
2024년 11월 15일

댓글:

MD
2024년 11월 16일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by