Change datatip label when using DefaultInteractivity on UIAxes in App Designer

3 Ansichten (letzte 30 Tage)
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?

Antworten (1)

Sameer
Sameer am 30 Mai 2025
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!

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by