Custom axis scale and colorbar form imagesc

조회 수: 85 (최근 30일)
Raphaël
Raphaël 2018년 11월 23일
답변: Raphaël 2018년 11월 23일
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

채택된 답변

Raphaël
Raphaël 2018년 11월 23일
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]

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Blue에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by