Change datatip label when using DefaultInteractivity on UIAxes in App Designer
7 次查看(过去 30 天)
显示 更早的评论
I have a 3D plot on an UIAxes in App Designer that is generating data points at specified x,y and z coordinates. Each of these points corresponds to a a physical location along a vehicle and I have the string descriptions of each stored in an array. I would like to display this description in place of or alongside the coordinates. Is this possible to do in Matlab ver. 2019b?
0 个评论
回答(1 个)
Sameer
2025-5-30
Hi @Jimmy Smith
It is possible to display string descriptions alongside data points in a 3D plot on a "UIAxes" in App Designer. This can be done using the "text" function, which allows adding text labels at specified x, y, and z coordinates.
Assuming the coordinates are stored in vectors "x", "y", and "z", and the descriptions are in a string array "labels", the following can be used:
for i = 1:length(x)
text(app.UIAxes, x(i), y(i), z(i), labels(i));
end
This will place each label at the corresponding 3D point. The labels will appear next to or on top of each data point in the "UIAxes".
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Develop Apps Using App Designer 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!