Putting Annotation in 3D Space - seems impossible

조회 수: 108 (최근 30일)
Oliver Ng Kwong Sang
Oliver Ng Kwong Sang 2020년 12월 2일
답변: Divija Aleti 2020년 12월 8일
Problem: I am trying to put an annotation (An arrow and a text) in a figure that is 3D. But it has been a big struggle so far after trying for 2 days. First the problem with annotation is you have to use normalised units to position the annotation. I found a way around this and was able to use true x and y coordinate values instead to position the annotation.
But now I am trying to put the annotation in 3D space. I can easily put an annotation in 2D space but in 3D space, there is a problem: I cannot add the z-coordinate for it. The Syntax for annotation is like this: a = annotation('textarrow',x,y,'String','Write text here'); where x and y are the normalised unit for the figure. When I try to add z into it, MATLAB gives an error which states the vector ([x y z]) is too big.
Could someone please tell me how to solve this? Or is there another function instead to use in 3D space?
(Note: I tried using text function in 3D space and it works but I would like to use annotation because I can then put an arrow and a text.)
Thank you MATLAB community!

채택된 답변

Divija Aleti
Divija Aleti 2020년 12월 8일
Hi Oliver,
The annotation function with the same syntax - 'a= annotation('textarrow',x,y,'String','Write text here');' can be used for 3D space too. It shows the annotation on the figure, but the z-position cannot be specified.
However, in order to put an arrow in a particular position in 3D space, that is, specify x,y and z positions, you can use the 'arrow' function. This can be downloaded from the link below:
After putting the arrow, you can use the 'text' function to display your text:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by