Change datatip label when using DefaultInteractivity on UIAxes in App Designer

3 vues (au cours des 30 derniers jours)
Jimmy Smith
Jimmy Smith le 23 Juin 2020
Réponse apportée : Sameer le 30 Mai 2025
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?

Réponses (1)

Sameer
Sameer le 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!

Catégories

En savoir plus sur Develop Apps Using App Designer dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by