Avoid deleting of datatip when clicking on marker
Mostra commenti meno recenti
When creating a datatip DT, it is deleted when I click on the marker without moving the DT.
Example:
figure
h = plot(rand(100,1));
DT = datatip(h,'DataIndex',22);
Now, clicking on the marker of the DT without moving this, will delete the DT when releasing the mouse-button. Important: I still want to be able to move the DT, it should just not be deleted when clicking on it without moving it.
Is there a simple way of preventing this from happening? I implemented a solution using listeners and undocumented stuff, but I was wondering if there is a simple solution that I'm just missing.
Risposta accettata
Più risposte (1)
Matlab Pro
il 6 Giu 2024
Just set the 'PickableParts' = 'none'
DT = datatip(h,'DataIndex',22,'PickableParts','none');
1 Commento
Sebastian Hölz
il 7 Giu 2024
Modificato: Sebastian Hölz
il 10 Giu 2024
Categorie
Scopri di più su Graphics Object Properties in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!