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]);

Respuestas (1)

Walter Roberson
Walter Roberson el 15 de Nov. de 2024

0 votos

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 comentario

MD
MD el 16 de Nov. de 2024
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.

Iniciar sesión para comentar.

Categorías

Productos

Versión

R2024a

Preguntada:

MD
el 15 de Nov. de 2024

Comentada:

MD
el 16 de Nov. de 2024

Community Treasure Hunt

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

Start Hunting!

Translated by