How to give colorbar to a tif image in Matlab

7 vues (au cours des 30 derniers jours)
Shilpa S
Shilpa S le 24 Nov 2022
x = imread('C:\Users\user\Desktop\PHD EXP Work\ACLPP\9air.tif');
imshow(x);
colorbar;

Réponses (2)

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 24 Nov 2022
Have tried this syntax:
[X,Cmap]= imread('IMAGE.tif');
image(X);
colormap(Cmap);
  1 commentaire
Shilpa S
Shilpa S le 24 Nov 2022
I tried it. only got x-y axis with some numbers

Connectez-vous pour commenter.


Walter Roberson
Walter Roberson le 24 Nov 2022
If the tif is rgb then there is no meaningful colorbar for it.
If the tif is not rgb then imshow would have automatically used colormap(grey) and colorbar() would draw the grayscale.

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!

Translated by