How to dispaly the value in imshow
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Kwanghun Choi
le 12 Déc 2017
Modifié(e) : Chris Perkins
le 14 Déc 2017
I make code for inserting elevation value into pixel on contour line
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/167582/image.png)
Red line : not inserted
yellow point : Selected point to insert elevation
violet line : already inserted<-automatically when I insert elevation into yellow point
problem is I forget the value easily. So I want to display the value of violet line. I use imshow to display that image. How can I add displaying value of pixel on that image??
0 commentaires
Réponse acceptée
Chris Perkins
le 14 Déc 2017
Modifié(e) : Chris Perkins
le 14 Déc 2017
Hi Kwanghun,
You can use "annotation" to place text on your figure.
Here is an example:
% Just setting up a sample image, your image would replace this section
>> figure
>> imshow('peppers.png');
% You can set this to be any value you would like,
% depending on how your violet line value is represented in your code
>> valueOfVioletLine = 27.3;
% Making the Annotation
>> annotation('textbox',[.2 .2 .3 .3],'String',valueOfVioletLine,'LineStyle','none')
You can change the annotation's properties quite a bit to customize the appearance. See the following documentation links for more information.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Display Image 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!