Create Custom Data Tips with imagesc
15 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Tyler Gerhardson
le 22 Jan 2021
Commenté : Tyler Gerhardson
le 25 Jan 2021
Is it possible to modify the data tip of a figure generated with imagesc using the .DataTipTemplate property?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/496923/image.png)
0 commentaires
Réponse acceptée
Shubham Rawat
le 25 Jan 2021
Hi Tyler,
Yes you can modify the data tip of a figure generated with imagesc using the .DataTipTemplate property.
You may modify the following code to use DataTipTemplate property.
C = [0 2 4 6; 8 10 12 14; 16 18 20 22];
clims = [4 18];
i = imagesc(C,clims); % scaled color image object in variable 'i'
d = datatip(i,2,2); % by this data tip show up in image
% without using the above line it will show up the error.
c = i.DataTipTemplate(); % DataTipTemplate is used as function
c =
DataTipTemplate with properties:
DataTipRows: [1×3 matlab.graphics.datatip.DataTipTextRow]
Interpreter: 'tex'
FontSize: 10
FontAngle: 'normal'
FontName: 'Helvetica'
Hope this Helps!
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Logical 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!