Putting Annotation in 3D Space - seems impossible
103 次查看(过去 30 天)
显示 更早的评论
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!
0 个评论
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!