i need help with
how to draw an arrow to point in a specific direction

답변 (1개)

Cris LaPierre
Cris LaPierre 2023년 7월 25일

0 개 추천

댓글 수: 5

Tasneem Abed
Tasneem Abed 2023년 7월 25일
how to specify
x and y??
Cris LaPierre
Cris LaPierre 2023년 7월 25일
편집: Cris LaPierre 2023년 7월 25일
By default, these are in normalized units (percentage of your x and y range).
There is an example on the linked page that demonstrates how to use it. The first value in x and y correspond to the tail position, and the 2nd values correspond to the head.
Tasneem Abed
Tasneem Abed 2023년 7월 25일
the x-axis is from 0 to 24 how to convert that to 1
and so is the y-axis???????
Walter Roberson
Walter Roberson 2023년 7월 25일
Be careful, the positions for annotation() can only be absolute coordinates or coordinates normalized to the figure. There is no way to specify data units.
There are File Exchange contributions to make it easier to use data units
Here's an example of one such program on the File Exchange
% add an annotation pointing to the 5th data point
x = 0:24;
y = randi(6000,size(x));
plot(x,y)
S = sprintf("A2="+y(5));
xa = [-1 0]+x(5);
ya = [-1000 0]+y(5);
[xaf,yaf] = ds2nfu(xa,ya);
annotation('textarrow', xaf, yaf,'String',S)

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

카테고리

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

제품

태그

질문:

2023년 7월 25일

댓글:

2023년 7월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by