Putting Annotation in 3D Space - seems impossible

133 ビュー (過去 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 Center および File ExchangeAnnotations についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by