Custom axis scale and colorbar form imagesc

85 vues (au cours des 30 derniers jours)
Raphaël
Raphaël le 23 Nov 2018
Hi,
I have an image I'm displaying with imagesc. By default, Matlab gives you the x and y axis of the pixel number. So if I have a 500x400 image, the y and x scale will go frim 1 to 500 and 1 to 400.
Instead, I would like that those axis show me the position in mm. My 500x400 image represent a real image of 10mm x 8mm. I would like my axis to show me values ranging from 0 to 10mm and 0 to 8mm. Is it possible in Matlab?
Furthermore, is is possible to have a log scale colorbar? I display the log10(image) values instead of image values and it would be nice to have the colorbar showing the real values.
Thank you for the help.
RMT

Réponse acceptée

Raphaël
Raphaël le 23 Nov 2018
imagesc(x,y,image)
where
-image is a 2D matrix cointaining the data
-x is a two value vector corresponding to the start and end of the scaling, x = [0 8]
-y is a two value vector corresponding to the start and end of the scaling, y = [0 10]

Plus de réponses (0)

Catégories

En savoir plus sur Blue dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by