Change datatip label when using DefaultInteractivity on UIAxes in App Designer

8 ビュー (過去 30 日間)
Jimmy Smith
Jimmy Smith 2020 年 6 月 23 日
回答済み: Sameer 2025 年 5 月 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?

回答 (1 件)

Sameer
Sameer 2025 年 5 月 30 日
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!

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by